Plural-Forms for every language
The gettext Plural-Forms header for 209 languages, built from the CLDR 47 plural rules and checked against them number by number, and a checker for the header your catalogue already has.
Check a Plural-Forms header
Paste the value, the whole "Plural-Forms: ...\n" line, or the header block of a .po file. Nothing leaves your browser.
How gettext picks a form
A translated message with a number has one msgstr per form: msgstr[0], msgstr[1] and so on. When a program calls ngettext() with a count, gettext puts the count into the plural= expression of the catalogue's header as n and shows the form the expression returns. nplurals= says how many forms each message has.
The expression is a C expression over whole numbers: n, numbers, comparisons, %, &&, ||, ! and ? :. English needs two forms, and (n != 1) returns 0 for 1 and 1 for every other count. Russian needs three, chosen by the last digits: 1, 21 and 101 take one form, 2 to 4 and 22 to 24 another, and 0, 5 to 20 and 25 to 30 the third.
What the checker looks at
- The expression itself. It must parse, use nothing but
n, and return a whole number from 0 tonpluralsminus one for every count. A division by zero or a form out of range shows the wrong text, or none. - One CLDR form per
msgstr. CLDR, the Unicode Consortium's data on languages, says which numbers share a word form. If onemsgstrgets numbers from two of them, Russian 2 and 5 for instance, no translation of it can be right for both. A common cause is an English header left in a catalogue for another language. - Every form used. A form no number reaches is a translation nobody sees. A CLDR form spread over two
msgstronly makes translators write the same text twice. - Where the number must show. A form used for several numbers cannot say "one": Russian
msgstr[0]is also used for 21, 31 and 101, Frenchmsgstr[0]for 0 as well as 1. Its translation needs the number, as%d,{count}or whatever your format uses.
The checker evaluates the header for 22,017 counts: every number from 0 to 20,000, every thousand up to 2,000,000, and round numbers up to a billion. The order of the forms is a convention. The table follows CLDR's order, zero, one, two, few, many, other; a header in another order works as long as each translation sits in the form its numbers get.
Why some headers differ from CLDR
Fractions. CLDR also has forms for fractional numbers: Russian uses "other" for 1.5, Czech "many" for 0.5. gettext counts are whole numbers, so those forms get no msgstr. That is why a header generated straight from CLDR, by Babel's to_gettext() for one, gives Russian, Ukrainian, Polish, Czech and Slovak four forms while their catalogues have three. For French and Portuguese, among others, it also writes CLDR's e operand into the expression, which gettext does not know.
Round millions. Recent CLDR versions give exact millions a separate form in Breton, Catalan, French, Italian, Portuguese, Sicilian, Spanish and Venetian: French and Spanish write un million de fichiers, un millón de archivos. Most catalogues keep the usual forms and accept that; the table gives the exact header under the usual one.
Older headers. Some headers in older guides and catalogues predate CLDR's rules and split the numbers differently, the long-standing Welsh and Latvian ones among them. If your catalogue already uses one, changing the header changes what msgstr[0], msgstr[1] and the rest mean: move the translations with it, or keep the old header.
All 209 languages
Each header puts every whole number on the form of its CLDR category. The last column shows which numbers go where, up to 199. Languages are listed by English name, with their CLDR code.
| Language | Code | Forms | Plural-Forms | Numbers in each form |
|---|---|---|---|---|
| Afrikaans | af | 2 | nplurals=2; plural=(n != 1); |
|
| Akan | ak | 2 | nplurals=2; plural=(n > 1); |
|
| Albanian | sq | 2 | nplurals=2; plural=(n != 1); |
|
| Amharic | am | 2 | nplurals=2; plural=(n > 1); |
|
| Anii | blo | 3 | nplurals=3; plural=(n == 0) ? 0 : (n == 1) ? 1 : 2; |
|
| Arabic | ar | 6 | nplurals=6; plural=(n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((n % 100 >= 3 && n % 100 <= 10) ? 3 : ((n % 100 >= 11) ? 4 : 5)))); |
|
| Aragonese | an | 2 | nplurals=2; plural=(n != 1); |
|
| Armenian | hy | 2 | nplurals=2; plural=(n > 1); |
|
| Assamese | as | 2 | nplurals=2; plural=(n > 1); |
|
| Asturian | ast | 2 | nplurals=2; plural=(n != 1); |
|
| Asu | asa | 2 | nplurals=2; plural=(n != 1); |
|
| Azerbaijani | az | 2 | nplurals=2; plural=(n != 1); |
|
| Baluchi | bal | 2 | nplurals=2; plural=(n != 1); |
|
| Bambara | bm | 1 | nplurals=1; plural=0; |
|
| Bangla | bn | 2 | nplurals=2; plural=(n > 1); |
|
| Basque | eu | 2 | nplurals=2; plural=(n != 1); |
|
| Belarusian | be | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2; |
|
| Bemba | bem | 2 | nplurals=2; plural=(n != 1); |
|
| Bena | bez | 2 | nplurals=2; plural=(n != 1); |
|
| Bhojpuri | bho | 2 | nplurals=2; plural=(n > 1); |
|
| Bodo | brx | 2 | nplurals=2; plural=(n != 1); |
|
| Bosnian | bs | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2; |
|
| Breton | br | 4 | nplurals=4; plural=(n % 10 == 1 && !(n % 100 == 11 || n % 100 == 71 || n % 100 == 91)) ? 0 : (n % 10 == 2 && !(n % 100 == 12 || n % 100 == 72 || n % 100 == 92)) ? 1 : ((n % 10 >= 3 && n % 10 <= 4 || n % 10 == 9) && !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 || n % 100 >= 90 && n % 100 <= 99)) ? 2 : 3;Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Bulgarian | bg | 2 | nplurals=2; plural=(n != 1); |
|
| Burmese | my | 1 | nplurals=1; plural=0; |
|
| Cantonese | yue | 1 | nplurals=1; plural=0; |
|
| Catalan | ca | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Cebuano | ceb | 2 | nplurals=2; plural=(n == 1 || n == 2 || n == 3 || !(n % 10 == 4 || n % 10 == 6 || n % 10 == 9)) ? 0 : 1; |
|
| Central Atlas Tamazight | tzm | 2 | nplurals=2; plural=(n <= 1 || n >= 11 && n <= 99) ? 0 : 1; |
|
| Central Kurdish | ckb | 2 | nplurals=2; plural=(n != 1); |
|
| Chechen | ce | 2 | nplurals=2; plural=(n != 1); |
|
| Cherokee | chr | 2 | nplurals=2; plural=(n != 1); |
|
| Chiga | cgg | 2 | nplurals=2; plural=(n != 1); |
|
| Chinese | zh | 1 | nplurals=1; plural=0; |
|
| Colognian | ksh | 3 | nplurals=3; plural=(n == 0) ? 0 : (n == 1) ? 1 : 2; |
|
| Cornish | kw | 6 | nplurals=6; plural=(n == 0) ? 0 : (n == 1) ? 1 : (n % 100 == 2 || n % 100 == 22 || n % 100 == 42 || n % 100 == 62 || n % 100 == 82 || n % 1000 == 0 && (n % 100000 >= 1000 && n % 100000 <= 20000 || n % 100000 == 40000 || n % 100000 == 60000 || n % 100000 == 80000) || n != 0 && n % 1000000 == 100000) ? 2 : (n % 100 == 3 || n % 100 == 23 || n % 100 == 43 || n % 100 == 63 || n % 100 == 83) ? 3 : (n != 1 && (n % 100 == 1 || n % 100 == 21 || n % 100 == 41 || n % 100 == 61 || n % 100 == 81)) ? 4 : 5; |
|
| Croatian | hr | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2; |
|
| Czech | cs | 3 | nplurals=3; plural=(n == 1) ? 0 : ((n >= 2 && n <= 4) ? 1 : 2); |
|
| Danish | da | 2 | nplurals=2; plural=(n != 1); |
|
| Divehi | dv | 2 | nplurals=2; plural=(n != 1); |
|
| Dogri | doi | 2 | nplurals=2; plural=(n > 1); |
|
| Dutch | nl | 2 | nplurals=2; plural=(n != 1); |
|
| Dzongkha | dz | 1 | nplurals=1; plural=0; |
|
| English | en | 2 | nplurals=2; plural=(n != 1); |
|
| Esperanto | eo | 2 | nplurals=2; plural=(n != 1); |
|
| Estonian | et | 2 | nplurals=2; plural=(n != 1); |
|
| Ewe | ee | 2 | nplurals=2; plural=(n != 1); |
|
| Faroese | fo | 2 | nplurals=2; plural=(n != 1); |
|
| Filipino | fil | 2 | nplurals=2; plural=(n != 1 && n != 2 && n != 3 && (n % 10 == 4 || n % 10 == 6 || n % 10 == 9)); |
|
| Finnish | fi | 2 | nplurals=2; plural=(n != 1); |
|
| French | fr | 2 | nplurals=2; plural=(n > 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Friulian | fur | 2 | nplurals=2; plural=(n != 1); |
|
| Fula | ff | 2 | nplurals=2; plural=(n > 1); |
|
| Galician | gl | 2 | nplurals=2; plural=(n != 1); |
|
| Ganda | lg | 2 | nplurals=2; plural=(n != 1); |
|
| Georgian | ka | 2 | nplurals=2; plural=(n != 1); |
|
| German | de | 2 | nplurals=2; plural=(n != 1); |
|
| Greek | el | 2 | nplurals=2; plural=(n != 1); |
|
| Gujarati | gu | 2 | nplurals=2; plural=(n > 1); |
|
| Hausa | ha | 2 | nplurals=2; plural=(n != 1); |
|
| Hawaiian | haw | 2 | nplurals=2; plural=(n != 1); |
|
| Hebrew | he | 3 | nplurals=3; plural=(n == 1) ? 0 : ((n == 2) ? 1 : 2); |
|
| Hindi | hi | 2 | nplurals=2; plural=(n > 1); |
|
| Hmong Njua | hnj | 1 | nplurals=1; plural=0; |
|
| Hungarian | hu | 2 | nplurals=2; plural=(n != 1); |
|
| Icelandic | is | 2 | nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1; |
|
| Ido | io | 2 | nplurals=2; plural=(n != 1); |
|
| Igbo | ig | 1 | nplurals=1; plural=0; |
|
| Inari Sami | smn | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Indonesian | id | 1 | nplurals=1; plural=0; |
|
| Interlingua | ia | 2 | nplurals=2; plural=(n != 1); |
|
| Inuktitut | iu | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Irish | ga | 5 | nplurals=5; plural=(n == 1) ? 0 : (n == 2) ? 1 : (n >= 3 && n <= 6) ? 2 : (n >= 7 && n <= 10) ? 3 : 4; |
|
| Italian | it | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Japanese | ja | 1 | nplurals=1; plural=0; |
|
| Javanese | jv | 1 | nplurals=1; plural=0; |
|
| Jju | kaj | 2 | nplurals=2; plural=(n != 1); |
|
| Kabuverdianu | kea | 1 | nplurals=1; plural=0; |
|
| Kabyle | kab | 2 | nplurals=2; plural=(n > 1); |
|
| Kako | kkj | 2 | nplurals=2; plural=(n != 1); |
|
| Kalaallisut | kl | 2 | nplurals=2; plural=(n != 1); |
|
| Kannada | kn | 2 | nplurals=2; plural=(n > 1); |
|
| Kashmiri | ks | 2 | nplurals=2; plural=(n != 1); |
|
| Kazakh | kk | 2 | nplurals=2; plural=(n != 1); |
|
| Khmer | km | 1 | nplurals=1; plural=0; |
|
| Korean | ko | 1 | nplurals=1; plural=0; |
|
| Koyraboro Senni | ses | 1 | nplurals=1; plural=0; |
|
| Kurdish | ku | 2 | nplurals=2; plural=(n != 1); |
|
| Kyrgyz | ky | 2 | nplurals=2; plural=(n != 1); |
|
| Lakota | lkt | 1 | nplurals=1; plural=0; |
|
| Langi | lag | 3 | nplurals=3; plural=(n == 0) ? 0 : ((n == 0 || n == 1) && n != 0) ? 1 : 2; |
|
| Lao | lo | 1 | nplurals=1; plural=0; |
|
| Latvian | lv | 3 | nplurals=3; plural=(n % 10 == 0 || n % 100 >= 11 && n % 100 <= 19) ? 0 : (n % 10 == 1 && n % 100 != 11) ? 1 : 2; |
|
| Ligurian | lij | 2 | nplurals=2; plural=(n != 1); |
|
| Lingala | ln | 2 | nplurals=2; plural=(n > 1); |
|
| Lithuanian | lt | 3 | nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > 19)) ? 0 : (n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? 1 : 2; |
|
| Lojban | jbo | 1 | nplurals=1; plural=0; |
|
| Lower Sorbian | dsb | 4 | nplurals=4; plural=(n % 100 == 1) ? 0 : (n % 100 == 2) ? 1 : (n % 100 >= 3 && n % 100 <= 4) ? 2 : 3; |
|
| Lule Sami | smj | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Luxembourgish | lb | 2 | nplurals=2; plural=(n != 1); |
|
| Macedonian | mk | 2 | nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1; |
|
| Machame | jmc | 2 | nplurals=2; plural=(n != 1); |
|
| Makonde | kde | 1 | nplurals=1; plural=0; |
|
| Malagasy | mg | 2 | nplurals=2; plural=(n > 1); |
|
| Malay | ms | 1 | nplurals=1; plural=0; |
|
| Malayalam | ml | 2 | nplurals=2; plural=(n != 1); |
|
| Maltese | mt | 5 | nplurals=5; plural=(n == 1) ? 0 : (n == 2) ? 1 : (n == 0 || n % 100 >= 3 && n % 100 <= 10) ? 2 : (n % 100 >= 11 && n % 100 <= 19) ? 3 : 4; |
|
| Manx | gv | 4 | nplurals=4; plural=(n % 10 == 1) ? 0 : (n % 10 == 2) ? 1 : (n % 100 == 0 || n % 100 == 20 || n % 100 == 40 || n % 100 == 60 || n % 100 == 80) ? 2 : 3; |
|
| Marathi | mr | 2 | nplurals=2; plural=(n != 1); |
|
| Masai | mas | 2 | nplurals=2; plural=(n != 1); |
|
| Metaʼ | mgo | 2 | nplurals=2; plural=(n != 1); |
|
| Mongolian | mn | 2 | nplurals=2; plural=(n != 1); |
|
| Nama | naq | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Nepali | ne | 2 | nplurals=2; plural=(n != 1); |
|
| Ngiemboon | nnh | 2 | nplurals=2; plural=(n != 1); |
|
| Ngomba | jgo | 2 | nplurals=2; plural=(n != 1); |
|
| Nigerian Pidgin | pcm | 2 | nplurals=2; plural=(n > 1); |
|
| North Ndebele | nd | 2 | nplurals=2; plural=(n != 1); |
|
| Northern Sami | se | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Northern Sotho | nso | 2 | nplurals=2; plural=(n > 1); |
|
| Norwegian | no | 2 | nplurals=2; plural=(n != 1); |
|
| Norwegian Bokmål | nb | 2 | nplurals=2; plural=(n != 1); |
|
| Norwegian Nynorsk | nn | 2 | nplurals=2; plural=(n != 1); |
|
| Nyanja | ny | 2 | nplurals=2; plural=(n != 1); |
|
| Nyankole | nyn | 2 | nplurals=2; plural=(n != 1); |
|
| N’Ko | nqo | 1 | nplurals=1; plural=0; |
|
| Odia | or | 2 | nplurals=2; plural=(n != 1); |
|
| Oromo | om | 2 | nplurals=2; plural=(n != 1); |
|
| Osage | osa | 1 | nplurals=1; plural=0; |
|
| Ossetic | os | 2 | nplurals=2; plural=(n != 1); |
|
| Papiamento | pap | 2 | nplurals=2; plural=(n != 1); |
|
| Pashto | ps | 2 | nplurals=2; plural=(n != 1); |
|
| Persian | fa | 2 | nplurals=2; plural=(n > 1); |
|
| Polish | pl | 3 | nplurals=3; plural=(n == 1) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); |
|
| Portuguese | pt | 2 | nplurals=2; plural=(n > 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Portuguese (Portugal) | pt-PT | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Prussian | prg | 3 | nplurals=3; plural=(n % 10 == 0 || n % 100 >= 11 && n % 100 <= 19) ? 0 : (n % 10 == 1 && n % 100 != 11) ? 1 : 2; |
|
| Punjabi | pa | 2 | nplurals=2; plural=(n > 1); |
|
| Romanian | ro | 3 | nplurals=3; plural=(n == 1) ? 0 : ((n == 0 || n % 100 >= 1 && n % 100 <= 19) ? 1 : 2); |
|
| Romansh | rm | 2 | nplurals=2; plural=(n != 1); |
|
| Rombo | rof | 2 | nplurals=2; plural=(n != 1); |
|
| Russian | ru | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); |
|
| Rwa | rwk | 2 | nplurals=2; plural=(n != 1); |
|
| Saho | ssy | 2 | nplurals=2; plural=(n != 1); |
|
| Samburu | saq | 2 | nplurals=2; plural=(n != 1); |
|
| Sango | sg | 1 | nplurals=1; plural=0; |
|
| Santali | sat | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Sardinian | sc | 2 | nplurals=2; plural=(n != 1); |
|
| Scottish Gaelic | gd | 4 | nplurals=4; plural=(n == 1 || n == 11) ? 0 : ((n == 2 || n == 12) ? 1 : ((n > 2 && n < 20) ? 2 : 3)); |
|
| Sena | seh | 2 | nplurals=2; plural=(n != 1); |
|
| Serbian | sr | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); |
|
| Shambala | ksb | 2 | nplurals=2; plural=(n != 1); |
|
| Shona | sn | 2 | nplurals=2; plural=(n != 1); |
|
| Sichuan Yi | ii | 1 | nplurals=1; plural=0; |
|
| Sicilian | scn | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Sindhi | sd | 2 | nplurals=2; plural=(n != 1); |
|
| Sinhala | si | 2 | nplurals=2; plural=(n > 1); |
|
| Skolt Sami | sms | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Slovak | sk | 3 | nplurals=3; plural=(n == 1) ? 0 : ((n >= 2 && n <= 4) ? 1 : 2); |
|
| Slovenian | sl | 4 | nplurals=4; plural=(n % 100 == 1) ? 0 : ((n % 100 == 2) ? 1 : ((n % 100 == 3 || n % 100 == 4) ? 2 : 3)); |
|
| Soga | xog | 2 | nplurals=2; plural=(n != 1); |
|
| Somali | so | 2 | nplurals=2; plural=(n != 1); |
|
| South Ndebele | nr | 2 | nplurals=2; plural=(n != 1); |
|
| Southern Kurdish | sdh | 2 | nplurals=2; plural=(n != 1); |
|
| Southern Sami | sma | 3 | nplurals=3; plural=(n == 1) ? 0 : (n == 2) ? 1 : 2; |
|
| Southern Sotho | st | 2 | nplurals=2; plural=(n != 1); |
|
| Spanish | es | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Sundanese | su | 1 | nplurals=1; plural=0; |
|
| Swahili | sw | 2 | nplurals=2; plural=(n != 1); |
|
| Swampy Cree | csw | 2 | nplurals=2; plural=(n > 1); |
|
| Swati | ss | 2 | nplurals=2; plural=(n != 1); |
|
| Swedish | sv | 2 | nplurals=2; plural=(n != 1); |
|
| Swiss German | gsw | 2 | nplurals=2; plural=(n != 1); |
|
| Syriac | syr | 2 | nplurals=2; plural=(n != 1); |
|
| Tachelhit | shi | 3 | nplurals=3; plural=(n == 0 || n == 1) ? 0 : (n >= 2 && n <= 10) ? 1 : 2; |
|
| Tamil | ta | 2 | nplurals=2; plural=(n != 1); |
|
| Telugu | te | 2 | nplurals=2; plural=(n != 1); |
|
| Teso | teo | 2 | nplurals=2; plural=(n != 1); |
|
| Thai | th | 1 | nplurals=1; plural=0; |
|
| Tibetan | bo | 1 | nplurals=1; plural=0; |
|
| Tigre | tig | 2 | nplurals=2; plural=(n != 1); |
|
| Tigrinya | ti | 2 | nplurals=2; plural=(n > 1); |
|
| Tok Pisin | tpi | 1 | nplurals=1; plural=0; |
|
| Tongan | to | 1 | nplurals=1; plural=0; |
|
| Tsonga | ts | 2 | nplurals=2; plural=(n != 1); |
|
| Tswana | tn | 2 | nplurals=2; plural=(n != 1); |
|
| Turkish | tr | 2 | nplurals=2; plural=(n != 1); |
|
| Turkmen | tk | 2 | nplurals=2; plural=(n != 1); |
|
| Tyap | kcg | 2 | nplurals=2; plural=(n != 1); |
|
| Ukrainian | uk | 3 | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); |
|
| Upper Sorbian | hsb | 4 | nplurals=4; plural=(n % 100 == 1) ? 0 : (n % 100 == 2) ? 1 : (n % 100 >= 3 && n % 100 <= 4) ? 2 : 3; |
|
| Urdu | ur | 2 | nplurals=2; plural=(n != 1); |
|
| Uyghur | ug | 2 | nplurals=2; plural=(n != 1); |
|
| Uzbek | uz | 2 | nplurals=2; plural=(n != 1); |
|
| Venda | ve | 2 | nplurals=2; plural=(n != 1); |
|
| Venetian | vec | 2 | nplurals=2; plural=(n != 1);Exact, with a separate form for round millions (1000000, 2000000, 3000000…): |
|
| Vietnamese | vi | 1 | nplurals=1; plural=0; |
|
| Volapük | vo | 2 | nplurals=2; plural=(n != 1); |
|
| Vunjo | vun | 2 | nplurals=2; plural=(n != 1); |
|
| Walloon | wa | 2 | nplurals=2; plural=(n > 1); |
|
| Walser | wae | 2 | nplurals=2; plural=(n != 1); |
|
| Welsh | cy | 6 | nplurals=6; plural=(n == 0) ? 0 : (n == 1) ? 1 : (n == 2) ? 2 : (n == 3) ? 3 : (n == 6) ? 4 : 5; |
|
| Western Frisian | fy | 2 | nplurals=2; plural=(n != 1); |
|
| Wolof | wo | 1 | nplurals=1; plural=0; |
|
| Xhosa | xh | 2 | nplurals=2; plural=(n != 1); |
|
| Yakut | sah | 1 | nplurals=1; plural=0; |
|
| Yiddish | yi | 2 | nplurals=2; plural=(n != 1); |
|
| Yoruba | yo | 1 | nplurals=1; plural=0; |
|
| Zulu | zu | 2 | nplurals=2; plural=(n > 1); |
|
Questions
Why does Babel give Russian four plural forms when gettext uses three?
CLDR gives Russian a fourth form, "other", for fractional numbers such as 1.5. Babel's to_gettext() turns every CLDR form into a msgstr, but a gettext count is always a whole number, so that fourth form is never used. The usual three-form header puts every whole number on the same form CLDR does.
Should a French, Spanish or Italian catalogue switch to the three-form header?
Only if the program shows exact millions with a plural, and the translations need the de form there. Changing nplurals means every plural entry needs a new msgstr, so most projects keep two forms. Both headers are in the table and both pass the checker.
Which languages are missing?
Languages without plural rules of their own in CLDR: a header for them would be a guess presented as data. A regional variant has a row of its own only where CLDR gives it different rules. European Portuguese is the one case: 0 takes the "other" form there, while Portuguese elsewhere puts 0 with 1.
How the table was made
The plural rules are CLDR 47 as Babel 2.18.0 ships them. For each of the 209 languages with rules of their own, every one of the 22,017 counts above was given its CLDR form. The header is the first one that puts all of them on the right msgstr: our own list from translation-checks, the usual (n != 1), (n > 1) or 0, or an expression compiled from the CLDR rule with the fraction and exponent operands set to zero. Every header was evaluated with the same parser the checker uses. A form CLDR uses only for fractions gets no msgstr, and a form used only for exact millions shares "other" in the main header.
Checking whole catalogues
This page checks one header. translation-checks, free under the MIT licence, checks a whole .po file with the same rules: the header, a msgstr for every form of every plural entry, the placeholders, numbers and tags of each translation, and forms used for several numbers that leave the number out. It runs as a pre-commit hook. Polyglot, one of our kits, translates catalogues with a local model and puts every line through those checks before it is written. How we checked the plural forms of our own 42 languages is in the field note gettext Plural-Forms, checked number by number.
Updated: