Skip to content

Commit

Permalink
Merge pull request #27 from hugovk/rename-ar_SA-to-ar
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 23, 2022
2 parents 6871118 + f7d4130 commit 3ddae94
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 3ddae94

Please sign in to comment.