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.
0sem comentários ainda