humanize icon indicating copy to clipboard operation
humanize copied to clipboard

Suggestion: Translate "migliaia" to "mila" in Italian

Open guanciottaman opened this issue 2 years ago • 3 comments

In Italian, to say 10 thousand, we say "10mila" (diecimila). It would be great to have that translation. Also, is there a way to have your humanize.po in your project folder and use that file for translations?

What versions are you using?

  • OS: Windows 11
  • Python: 3.11.4
  • Humanize: 4.7.0

guanciottaman avatar Aug 04 '23 12:08 guanciottaman

"migliaia" was added in https://github.com/python-humanize/humanize/pull/97 by @aborruso, would you like to agree together what it should be and create a new PR if needed?

Also, is there a way to have your humanize.po in your project folder and use that file for translations?

Yes, see the instructions at https://github.com/python-humanize/humanize#localization to do something like humanize.i18n.activate("pt_BR", path="path/to/my/own/translation/").

hugovk avatar Aug 04 '23 12:08 hugovk

Yes, see the instructions at https://github.com/python-humanize/humanize#localization to do something like humanize.i18n.activate("pt_BR", path="path/to/my/own/translation/").

The only thing that isn't clear to me is: how do I define a new translation, in which file extension/format?

guanciottaman avatar Aug 04 '23 22:08 guanciottaman

We start with .po files (in https://github.com/python-humanize/humanize/tree/main/src/humanize/locale) and then during release run scripts/generate-translation-binaries.sh, which essentially runs this command to compile binary .mo files:

msgfmt --check -o path/to/humanize{.mo,.po}

hugovk avatar Aug 05 '23 08:08 hugovk

Any more questions for this?

hugovk avatar Oct 01 '24 11:10 hugovk