Skip to content
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

Is Slovenian gettext plural form wrong? #22

Open
mlocati opened this issue Jan 16, 2015 · 6 comments
Open

Is Slovenian gettext plural form wrong? #22

mlocati opened this issue Jan 16, 2015 · 6 comments

Comments

@mlocati
Copy link

mlocati commented Jan 16, 2015

I think that in https://github.com/translate/l10n-guide/blob/master/docs/l10n/pluralforms.rst the plural form for Slovenian is wrong:
nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);

I don't know Slovenian, but it seems to me that it should be like the one described in gettext source code:
nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);

Please note that the values are shifted by one...

@mlocati mlocati mentioned this issue Mar 27, 2015
@beernarrd
Copy link

translate/translate#3273 explains why it was not wrong

@mlocati
Copy link
Author

mlocati commented Jan 25, 2018

Well, both in https://github.com/translate/translate/blob/master/translate/lang/data.py and in http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html I see that for Slovenian we have
n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3

Furthermore, using the gettext cldr-plurals tool (with the plurals.xml definition of CLDR 32.0.1:

cldr-plurals sl path/to/cldr/32.0.1/common/supplemental/plurals.xml

we have

nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100>=3 && n%100<=4 ? 2 : 3);

@beernarrd
Copy link

I don't know when it was reverted, but in 2015 it was allready fixed: https://github.com/translate/translate/blob/93dda8f3ab5e1a9e3e08466490e5037b793e34b4/translate/lang/data.py
Gnutext has also opened a bug on this topic since 2015 to change the documentation. https://savannah.gnu.org/bugs/?45591
If cldr-plurals tool need a bugreport to change the plural string to the good one, i will open it based on what will have been changed by #45591.

@beernarrd
Copy link

Found the reverting commit: translate/translate#3593. Must be undone.
As said there, we want to have this:
msgid[0] = CLRD other {0, 5..100, 105..200, ...}
msgid[1] = CLRD one {1, 101, 201, ...}
msgid[2] = CLRD two {2, 102, 202, ...}
msgid[3] = CLRD few {3,4; 103,104...}

nijel added a commit to WeblateOrg/language-data that referenced this issue Jan 26, 2018
nijel added a commit to WeblateOrg/language-data that referenced this issue Jan 26, 2018
@nijel
Copy link
Member

nijel commented Jan 26, 2018

The plurals for Slovenian are currently identical in Gettext, translate-toolkit and l10n guide and they also match CLDR. The ordering of plurals matches what is used in other languages - the first plural (having index 0) usually accounts for CLDR one (if language has it). On the other side I can see that quite some projects do use the alternative ordering which @beernarrd is pushing, so it certainly has some use. Anyway has somebody tried to push the change to Gettext? I think it really should start there so that new translations will get this automatically....

BTW: I'm currently looking into plurals anyway for Weblate (for WeblateOrg/weblate#1550), if you want to look deeper into differences between different source it's available here: https://github.com/WeblateOrg/language-data/blob/master/PLURALS_DIFF.md

@beernarrd
Copy link

I tried to push in gettext https://savannah.gnu.org/bugs/?45591

nijel added a commit to WeblateOrg/weblate that referenced this issue Jan 29, 2018
IMHO it's bad idea to be inconsistent with ordering all other languages
use, but anyway this has already quite widespread usage.

See translate/l10n-guide#22

Signed-off-by: Michal Čihař <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants