Dear (Slovenian) Translator
Feb 17th, 2011 by diegobz
Last week we came across an issue involving a request from Django. A person from the Slovenian team filed a ticket on the Django system asking to change the plural equation for the translation files. Once Django is now officially using Transifex for managing its translations, this ended up here to us.
Long short history…
Transifex plural rules are based on this document. The possible plural rules currently supported are 6, *always* in the respect order:
zero, one, two, few, many, other
The ‘other’ rule is the general exception for anything that doesn’t fit into the other rules. For Japanese, for example, that doesn’t have plural forms, it only uses the ‘other’ rule and nothing else.
According to the document above, Slovenian has 4 plural rules, which are:
one → n mod 100 is 1;
two → n mod 100 is 2;
few → n mod 100 in 3..4;
other → everything else
For the PO file format, the plural equation for the above would be:
(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)
Which means that for a sl.po with a plural entry, we would have the following mapping:
msgstr[0] → one
msgstr[1] → two
msgstr[2] → few
msgstr[3] → other
Back to the initial issue, for some reason good part of the Slovenian teams across the FOSS world started to prefer to use the following plural equation:
(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0)
This results in the following swapping of position:
msgstr[0] → other
msgstr[1] → one
msgstr[2] → two
msgstr[3] → few
This, as far as I know, because the ‘zero’ rule, which actually doesn’t exist for the language, just fits as the ‘other’ rule and in this way the ‘one’ and ‘two’ rules would have a synchronized msgstr index (e.g. msgstr[1] → one).
So, dear Slovenian translator, is there any other reason for doing it that I’m not aware of?
Changing that because of the above seems just wrong to me. And I would like to ask a greater audience of people that might be interested on it, before taking any decision on the Transifex side.
[...] This post was mentioned on Twitter by Jannis Leidel, Dimitris Glezos, Diego Búrigo Zacarão, Zuissi, Walter Alini and others. Walter Alini said: @garbas You are the only one I know -> RT Dear Slovenian, can you help us? http://diegobz.net/2011/02/17/dear-slovenian-translator/ [...]
Not to be biased (aka being from Slovenia as well), I like the new model better.
It makes direct sense when mapping number against msg index.
Where 0 is default, where even “none” can be applied.
I also think this is purely technical decision, language itself is not relevant.
e.g. same decision could be made by Chinese
HTH
It’s because of the language, nothing else. Being a native speaker, the switched rules make a lot of sense, but I have to agree this carries very little weight compared to consistency and I think you shouldn’t change it because of this habit.
There are two reasons:
1. “zero rule” = “other rule”
2. synchronized msgstr index
This gives us:
msgstr[0] → zero and other
msgstr[1] → one
msgstr[2] → two
msgstr[3] → few
The main reason is that there is some extreme beauty in the system. Not just for one [1] and two [2], but also for zero [0] (which belongs to “other” according to your system) and three [3] (3,4=few):
msgstr[0] → zero apples (=other)
msgstr[1] → one apple
msgstr[2] → two apples
msgstr[3] → three apples
as opposed to
msgstr[0] → one apple
msgstr[1] → two apples
msgstr[2] → three apples
msgstr[3] → zero apples
which hardly makes sense.
This leads to less errors during translation, it is much easier to remember, works almost everywhere and many teams go into the direction of this convention (some have just finished conversion and don’t want to go back).
Would this still be a problem for Django if all teams would stick to the more logical convention? Or rather: is it a problem just because it breaks your numbering system or is it a problem just because it is not consistent accross different teams?