Per discussion in #15920, I’ve figured out that in Russian we need 4 plural forms instead of 3 to distinguish a single item from 21, 31, etc. items in certain cases.
I’ve changed the Plural-Forms header in .po files to include the rule for a single item:
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n%10==1 && n%100!=11) ? 1 : ((n%10>=2 && n%10<=4 && (n%100=20)) ? 2 : 3);n"
and it works fine with Poedit. However when I import the translations into GlotPress, there are still only 3 forms. I guess the header is stored elsewhere.
Is it possible to update it in GlotPress both on translate.wordpress.org and translate.wordpress.com?
Zé 12:47 pm on December 26, 2010 Permalink |
Should be fixed in http://trac.glotpress.org/changeset/592
Sergey Biryukov 1:25 pm on December 26, 2010 Permalink |
Something wrong is going on there.
1. The new header is totally broken. The old one was OK, except that in certain cases we need an additional form for a single item. I’ve provided longer description in comments to #15920:
The header I’ve proposed does just that.
2. The GlotPress page for ru locale is not fully loaded, breaking right after
.Perhaps as a long-term solution it’s a good idea to use the header from .po file. If there’s none, then fall back to the default.
Sergey Biryukov 1:27 pm on December 26, 2010 Permalink |
…breaking at
<p class="plural-numbers">, I meant.Zé 1:35 pm on December 26, 2010 Permalink |
Checking
Zé 1:44 pm on December 26, 2010 Permalink |
Reverted the changeset for now. We took the expression from here: http://translate.sourceforge.net/wiki/l10n/pluralforms. Is it not correct?
Sergey Biryukov 2:29 pm on December 26, 2010 Permalink
It’s basically correct, but not sufficient for WordPress. I’ve provided the correct header in my post.
Nikolay Bachiyski 11:52 am on December 27, 2010 Permalink |
@Sergey, there was an error in the expression,
n%100=20should ben%100==20.@Zé, in that commit, you didn’t copy/paste the expression properly, and also the nplurals changed to 4. Not that any of that mattered, because of the syntax error in the expression itself
@Sergey, changing the plural forms entails some amount of work. We will need to re-index all translations. Now, index 0 is n%10==1 && n%100!=11, index 1 is n%10>=2 && n%10<=4 && (n%100=20) and 2 is the rest. If we change it, index 0 has to be only 1 and the rest need to shift one index position left. We can automate this and I guess you would like index 0 to be auto-populated with the current value of index 0, right? Can you take care of the conversion yourself? If yes, I can change the plural forms anytime.
Another thing. A change like this will affect all Russian translations on translate.wordpress.org and any other GlotPress installs. Some people may be used to the old plural forms. How badly do you need this change? Are the rest of the Russian translators generally OK with the change?
Zé 12:44 pm on December 27, 2010 Permalink |
You’re right, that’s what you get from post-xmas commits. A question for Sergey: wouldn’t the change also have to be applied to Ukrainian, which shares the same plural form?