Skip to content

Commit

Permalink
Rename Arabic locale from ar_SA to ar to enable fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 22, 2022
1 parent 410b51d commit 08c03f7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_i18n.py
Expand Up @@ -70,6 +70,29 @@ def test_intword_plurals(locale, number, expected_result):
humanize.i18n.deactivate()


@pytest.mark.parametrize(
("locale", "expected_result"),
(
("ar", "5خامس"),
("ar_SA", "5خامس"),
("fr", "5e"),
("fr_FR", "5e"),
("pt", "5º"),
("pt_BR", "5º"),
("pt_PT", "5º"),
),
)
def test_langauge_codes(locale, expected_result):
try:
humanize.i18n.activate(locale)
except FileNotFoundError:
pytest.skip("Generate .mo with scripts/generate-translation-binaries.sh")
else:
assert humanize.ordinal(5) == expected_result
finally:
humanize.i18n.deactivate()


@pytest.mark.parametrize(
("locale", "number", "gender", "expected_result"),
(
Expand Down

0 comments on commit 08c03f7

Please sign in to comment.