@@ -92,6 +92,10 @@ def test_i18n() -> None:
9292 assert humanize .naturaltime (three_seconds ) == "තත්පර 3කට පෙර"
9393 assert humanize .precisedelta (one_min_three_seconds ) == "විනාඩි 1යි තත්පර 7ක්"
9494
95+ humanize .i18n .activate ("bn_BD" )
96+ assert humanize .naturaltime (three_seconds ) == "3 সেকেন্ড সময় আগে"
97+ assert humanize .precisedelta (one_min_three_seconds ) == "1 মিনিট আর 7 সেকেন্ড"
98+
9599 except FileNotFoundError :
96100 pytest .skip ("Generate .mo with scripts/generate-translation-binaries.sh" )
97101
@@ -180,6 +184,10 @@ def test_naturaldelta() -> None:
180184 ("lv" , 2_000_000 , "2,0 miljoni" ),
181185 ("lv" , 11_000_000 , "11,0 miljoni" ),
182186 ("lv" , 21_000_000 , "21,0 miljons" ),
187+ ("bn_BD" , 2_000_000 , "2.0 মিলিয়ন" ),
188+ ("bn_BD" , 1_000_000_000_000_000_000_000_000_000_000 , "1.0 ননিলিয়ন" ),
189+ ("bn_BD" , 1_000_000_000_000_000_000_000_000_000_000_000 , "1.0 ডেসিলিয়ন" ),
190+ ("bn_BD" , 10 ** 100 , "1.0 গুগল" ),
183191 ("fr_FR" , "1_000" , "1,0 mille" ),
184192 ("fr_FR" , "12_400" , "12,4 milles" ),
185193 ("fr_FR" , "12_490" , "12,5 milles" ),
@@ -241,6 +249,8 @@ def test_intword_i18n(locale: str, number: int, expected_result: str) -> None:
241249 ("fr_FR" , 42 , "42 octets" ),
242250 ("si_LK" , 1 , "බයිට් 1" ),
243251 ("si_LK" , 42 , "බයිට් 42" ),
252+ ("bn_BD" , 1 , "1 বাইট" ),
253+ ("bn_BD" , 42 , "42 বাইট" ),
244254 ("fr_FR" , 42_000 , "42.0 Ko" ),
245255 ("fr_FR" , 42_000_000 , "42.0 Mo" ),
246256 ("fr_FR" , 42_000_000_000 , "42.0 Go" ),
@@ -269,6 +279,28 @@ def test_naturalsize_i18n_binary() -> None:
269279 humanize .i18n .deactivate ()
270280
271281
282+ @pytest .mark .parametrize (
283+ "locale, days, expected_result" ,
284+ [
285+ ("bn_BD" , 365 , "এক বছর" ),
286+ ("bn_BD" , 370 , "1 বছর, 5 দিন" ),
287+ ("bn_BD" , 396 , "1 বছর, 1 মাস" ),
288+ ("bn_BD" , 425 , "1 বছর, 2 মাস" ),
289+ ],
290+ )
291+ def test_naturaldelta_one_year_i18n (
292+ locale : str , days : int , expected_result : str
293+ ) -> None :
294+ try :
295+ humanize .i18n .activate (locale )
296+ except FileNotFoundError :
297+ pytest .skip ("Generate .mo with scripts/generate-translation-binaries.sh" )
298+ else :
299+ assert humanize .naturaldelta (dt .timedelta (days = days )) == expected_result
300+ finally :
301+ humanize .i18n .deactivate ()
302+
303+
272304@pytest .mark .parametrize (
273305 "locale, expected_result" ,
274306 [
0 commit comments