-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
German localisation should be improved #48
Comments
The translation files are located here: https://github.com/python-humanize/humanize/tree/main/src/humanize/locale I'm not sure whether they can handle a special case for single number like that because the pattern matches for "%s ago". Maybe poke around the language files and see if there are other languages that have a solution for this.
The translation files do support this type of plural selection. It probably just needs to be implemented in the translation file for German (see Spanish for an example).
Separator swapping is supported. This is done for French.
That's what unit tests are for 😉. |
This may be possible using something along the lines of: msgid "One file removed"
msgid_plural "%d files removed" https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html |
Are you sure this is supported? As far as I can tell, this only allows replacing |
No. I suggest starting with a PR for the simplest translation fixes, then we can discuss in further detail the scope of replacing |
@Luflosi Anything left to fix here? |
As you said in #93 (comment), Thank you for maintaining this project! |
What did you do?
Execute
What did you expect to happen?
I would expect the output to be 'vor einer Stunde'.
What actually happened?
The output was 'vor eine Stunde', which is grammatically incorrect.
"one hour" translates to "eine Stunde" but "one hour ago" translates to "vor einer Stunde". I think 1 is the only number where this special case happens.
What versions are you using?
Overall the support for German seems a bit lacking.
For example the
.
and,
in numbers are swapped compared to what's common in English, which this library doesn't support (humanize.intcomma(12345)
for example).humanize.intword(123455913)
outputs123.5 Million
butMillion
is singular. The correct output with a plural would be123.5 Millionen
, since 123.5 is more than 1 (actually I think it's correct to always use the plural when the value is not exactly equal to 1).Is this something you think would be worthwhile to improve? I could help you by trying to find more of these problems, testing patches or even writing some fixes myself if you help me a bit. I'm afraid if I just mess around in the translation file, I'll fix some specific problem I found but break other cases I didn't think about.
The text was updated successfully, but these errors were encountered: