Localization and plural forms

There are surprisingly many sources of information on plural forms in different languages (with examples for Russian language):

1. A page on Translate toolkit project site:

ru, Russian
nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && 
   n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)

2. Huge list on Launchpad:

Russian has 3 plural forms:
Form 0 for 1, 21, 31, 41, 51, 61...
Form 1 for 2, 3, 4, 22, 23, 24...
Form 2 for 0, 5, 6, 7, 8, 9...

3. Mozilla l10n and Plurals page and a equation in PluralForm.jsm:

Plural rule #7 (3 forms)
Families: Slavic (Croatian, Serbian, Russian, Ukrainian)
[3, function(n) n%10==1&&n%100!=11?0:n%10>=2&&
      n%10<=4&&(n%100<10||n%100>=20)?1:2],

4. General description on plural forms in gettext manual

5. Chart on Unicode CLDR:

Russian, ru
one → n mod 10 is 1 and n mod 100 is not 11;
few → n mod 10 in 2..4 and n mod 100 not in 12..14;
many → n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14;
other → everything else (1.31, 2.31, 5.31...)

(4 forms in CLDR? Strange… Can’t think of any example)

2038 views and 0 responses