Skip to content

Commit 65c4997

Browse files
authored
Complete and fix the Bengali (bn_BD) translation (#471)
1 parent 785e5dc commit 65c4997

2 files changed

Lines changed: 58 additions & 19 deletions

File tree

‎src/humanize/locale/bn_BD/LC_MESSAGES/humanize.po‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ msgstr[0] "হাজার"
125125
msgstr[1] "হাজার"
126126

127127
#: src/humanize/number.py:179
128-
#, fuzzy
129128
msgid "million"
130129
msgid_plural "million"
131130
msgstr[0] "মিলিয়ন"
@@ -176,25 +175,24 @@ msgstr[1] "ওকটিলিয়ন"
176175
#: src/humanize/number.py:187
177176
msgid "nonillion"
178177
msgid_plural "nonillion"
179-
msgstr[0] ""
180-
msgstr[1] ""
178+
msgstr[0] "ননিলিয়ন"
179+
msgstr[1] "ননিলিয়ন"
181180

182181
#: src/humanize/number.py:188
183-
#, fuzzy
184182
msgid "decillion"
185183
msgid_plural "decillion"
186-
msgstr[0] ""
187-
msgstr[1] ""
184+
msgstr[0] "ডেসিলিয়ন"
185+
msgstr[1] "ডেসিলিয়ন"
188186

189187
#: src/humanize/number.py:189
190188
msgid "googol"
191189
msgid_plural "googol"
192-
msgstr[0] ""
193-
msgstr[1] ""
190+
msgstr[0] "গুগল"
191+
msgstr[1] "গুগল"
194192

195193
#: src/humanize/number.py:301
196194
msgid "zero"
197-
msgstr "শুন্য"
195+
msgstr "শূন্য"
198196

199197
#: src/humanize/number.py:302
200198
msgid "one"
@@ -248,7 +246,7 @@ msgstr[1] "%d মিলিসেকেন্ড"
248246

249247
#: src/humanize/time.py:164 src/humanize/time.py:259
250248
msgid "a moment"
251-
msgstr "এক মুহুর্ত"
249+
msgstr "এক মুহূর্ত"
252250

253251
#: src/humanize/time.py:167
254252
msgid "a second"
@@ -274,14 +272,14 @@ msgstr[1] "%d মিনিট"
274272

275273
#: src/humanize/time.py:180
276274
msgid "an hour"
277-
msgstr "এক ঘন্টা"
275+
msgstr "এক ঘণ্টা"
278276

279277
#: src/humanize/time.py:184
280278
#, python-format
281279
msgid "%d hour"
282280
msgid_plural "%d hours"
283-
msgstr[0] "%d ঘন্টা"
284-
msgstr[1] "%d ঘন্টা"
281+
msgstr[0] "%d ঘণ্টা"
282+
msgstr[1] "%d ঘণ্টা"
285283

286284
#: src/humanize/time.py:188
287285
msgid "a day"
@@ -313,19 +311,19 @@ msgstr "এক বছর"
313311
#, python-format
314312
msgid "1 year, %d day"
315313
msgid_plural "1 year, %d days"
316-
msgstr[0] "%d বছর"
317-
msgstr[1] "%d বছর"
314+
msgstr[0] "1 বছর, %d দিন"
315+
msgstr[1] "1 বছর, %d দিন"
318316

319317
#: src/humanize/time.py:210
320318
msgid "1 year, 1 month"
321-
msgstr "১ বছর, ১ মাস"
319+
msgstr "1 বছর, 1 মাস"
322320

323321
#: src/humanize/time.py:213
324322
#, python-format
325323
msgid "1 year, %d month"
326324
msgid_plural "1 year, %d months"
327-
msgstr[0] "১ বছর, %d মাস"
328-
msgstr[1] "১ বছর, %d মাস"
325+
msgstr[0] "1 বছর, %d মাস"
326+
msgstr[1] "1 বছর, %d মাস"
329327

330328
#: src/humanize/time.py:219
331329
#, python-format
@@ -363,4 +361,13 @@ msgstr "গতকাল"
363361
#: src/humanize/time.py:600
364362
#, python-format
365363
msgid "%s and %s"
366-
msgstr "%s আর %s"
364+
msgstr "%s আর %s"
365+
366+
# --- filesize units (naturalsize) ---
367+
#, python-format
368+
msgid "%d Byte"
369+
msgstr "%d বাইট"
370+
371+
#, python-format
372+
msgid "%d Bytes"
373+
msgstr "%d বাইট"

‎tests/test_i18n.py‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)