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 6871118 commit f7d4130
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 @@ -94,6 +94,29 @@ def test_intword_plurals(locale: str, number: int, expected_result: str) -> None
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: str, expected_result: str) -> None:
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 f7d4130

Please sign in to comment.