Skip to content

Commit

Permalink
Merge pull request #66 from mariovalney/patch-1
Browse files Browse the repository at this point in the history
Add pt_BR separators
  • Loading branch information
hugovk committed Oct 21, 2022
2 parents 017af96 + 3de0209 commit d906c7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/humanize/i18n.py
Expand Up @@ -17,11 +17,13 @@
_THOUSANDS_SEPARATOR = {
"de_DE": ".",
"fr_FR": " ",
"pt_BR": ".",
}

# Mapping of locale to decimal separator
_DECIMAL_SEPARATOR = {
"de_DE": ",",
"pt_BR": ",",
}


Expand Down
3 changes: 3 additions & 0 deletions tests/test_i18n.py
Expand Up @@ -53,6 +53,9 @@ def test_intcomma() -> None:
humanize.i18n.activate("fr_FR")
assert humanize.intcomma(number) == "10 000 000"

humanize.i18n.activate("pt_BR")
assert humanize.intcomma(number) == "10.000.000"

except FileNotFoundError:
pytest.skip("Generate .mo with scripts/generate-translation-binaries.sh")

Expand Down

0 comments on commit d906c7d

Please sign in to comment.