Plural-Forms gettext pou 42 lang, tcheke nonm pa nonm kont CLDR
Lang yo
Yon antre pliryèl gettext kenbe fòm li yo nan plas nimewote, msgstr[0], msgstr[1] epi konsa, epi liy Plural-Forms nan tèt fichye a se yon ti fòmil C ki chwazi plas la pou yon nimewo. Pou Polyglot 1.4.0, nou te bezwen fòmil sa a pou tout 42 lang li tradui, epi chak plas te dwe kenbe fòm CLDR bay pou menm nimewo yo — CLDR se done pliryèl ki dèyè Android, ICU ak pwòp tcheke nou yo. Men tablo a, ak kijan nou te tcheke l.
Antèt pou chak lang CLDR gen règ pou pliryèl, ak yon tcheke pou pa w la, se sou Plural-Forms pou chak lang.
Kijan nou te tcheke l
- Chak nonm antye de 0 a 10,000: gettext Python li menm te evalye chak fòmil, epi plas li te chwazi a te dwe kenbe fòm done CLDR Babel 2.18 bay pou nonm sa a. 41 lang te koresponn; Kreyòl Ayisyen se sèl eksepsyon an, epi se yon eksepsyon vle (gade anba).
- GNU msgfmt --check sou yon fichye nan chak nan 42 lang yo, ak yon fòm nan chak plas: pa gen erè.
- Yon egzekisyon reyèl: fichye gettext aplikasyon egzanp lan, tradui pa modèl lokal nou an nan nèf lang, chak fichye konpile epi li li tounen ak gettext Python. Ris montre "Пропущена 21 привычка" men "Пропущено 22 привычки", Woumen "21 de obiceiuri" men "101 obiceiuri", epi Arab gen tout sis fòm li yo nan plas yo.
Kote ansyen done yo pa t dakò
Nou te kòmanse tcheke kont Babel 2.10, ki pote CLDR 41 soti 2022. Twa lang te soti diferan, epi nan chak ka, done pi resan an ak lang lan menm dakò ak tablo a:
- Woumen: CLDR 41 mete 101 ansanm ak 20 ak 100, ki pran "de" ("100 de zile"); CLDR aktyèl la mete l ansanm ak 2 a 19, ki pa pran "de". Modèl nou an te ekri "101 obiceiuri ratate", san "de".
- Ebre: CLDR 41 te toujou gen yon fòm "many" pou 20, 30, 40 elatriye. CLDR pi resan an te retire l, donk Ebre gen twa plas: youn, de ak lòt.
- Kreyòl Ayisyen pa t nan done sa a ditou. CLDR aktyèl la bay li de fòm, youn pou 0 ak 1 ak lòt pou rès la, men nonm Kreyòl pa chanje pou kantite ("1 liv", "2 liv"), donk nou te kenbe yon sèl plas, jan Polyglot fè nan lòt fòma yo.
Sa plas yo kenbe
- Ris, Ikranyen ak Polonè gen twa plas, epi twazyèm lan se "many" CLDR (0, 5 a 20, 25…), pa "other": "other" se pou fraksyon sèlman. "one" Polonè se 1 sèl; 21 se "many".
- Tchèque ak Slovak: "anpil" yo se pou fraksyon sèlman, kidonk twazyèm plas la se "other".
- Panyòl, Franse, Italyen ak Pòtigè gen yon fòm "anpil" pou milyon egzak; de plas gettext yo pa ka distenge l, kidonk li pataje "other".
- Franse, Pòtigè, Pèsyen, Amenyen, Amarik, Kannada ak Punjabi itilize "one" pou 0 tou, se poutèt sa
plural=(n > 1).
Tablo a
| Lang | gettext | Plural-Forms | msgstr[0], [1]… |
|---|---|---|---|
| Amarik | am | nplurals=2; plural=(n > 1); | one, other |
| Arab | ar | nplurals=6; plural=(n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((n % 100 >= 3 && n % 100 <= 10) ? 3 : ((n % 100 >= 11) ? 4 : 5)))); | zero, one, two, few, many, other |
| Amenyen | hy | nplurals=2; plural=(n > 1); | one, other |
| Bilg | bg | nplurals=2; plural=(n != 1); | one, other |
| Chinwa (Senplifye) | zh_CN | nplurals=1; plural=0; | other |
| Chinwa (Tradisyonèl) | zh_TW | nplurals=1; plural=0; | other |
| Tchèque | cs | nplurals=3; plural=(n == 1) ? 0 : ((n >= 2 && n <= 4) ? 1 : 2); | one, few, other |
| Olandè | nl | nplurals=2; plural=(n != 1); | one, other |
| Filipino | fil | nplurals=2; plural=(n != 1 && n != 2 && n != 3 && (n % 10 == 4 || n % 10 == 6 || n % 10 == 9)); | one, other |
| Finnwa | fi | nplurals=2; plural=(n != 1); | one, other |
| Franse | fr | nplurals=2; plural=(n > 1); | one, other |
| Alman | de | nplurals=2; plural=(n != 1); | one, other |
| Grèk | el | nplurals=2; plural=(n != 1); | one, other |
| Kreyòl Ayisyen | ht | nplurals=1; plural=0; | other |
| Ebre | he | nplurals=3; plural=(n == 1) ? 0 : ((n == 2) ? 1 : 2); | one, two, other |
| Ongwa | hu | nplurals=2; plural=(n != 1); | one, other |
| Endonezyen | id | nplurals=1; plural=0; | other |
| Italian | it | nplurals=2; plural=(n != 1); | one, other |
| Japone | ja | nplurals=1; plural=0; | other |
| Kannada | kn | nplurals=2; plural=(n > 1); | one, other |
| Khmer | km | nplurals=1; plural=0; | other |
| Koreyen | ko | nplurals=1; plural=0; | other |
| Masedonyen | mk | nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1; | one, other |
| Malay | ms | nplurals=1; plural=0; | other |
| Norvejyen Bokmål | nb | nplurals=2; plural=(n != 1); | one, other |
| Oromo | om | nplurals=2; plural=(n != 1); | one, other |
| Pèsyen | fa | nplurals=2; plural=(n > 1); | one, other |
| Polonè | pl | nplurals=3; plural=(n == 1) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); | one, few, many |
| Pòtigè (Brezil) | pt_BR | nplurals=2; plural=(n > 1); | one, other |
| Punjabi | pa | nplurals=2; plural=(n > 1); | one, other |
| Woumen | ro | nplurals=3; plural=(n == 1) ? 0 : ((n == 0 || n % 100 >= 1 && n % 100 <= 19) ? 1 : 2); | one, few, other |
| Risyen | ru | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); | one, few, many |
| Gaelik Ekosè | gd | nplurals=4; plural=(n == 1 || n == 11) ? 0 : ((n == 2 || n == 12) ? 1 : ((n > 2 && n < 20) ? 2 : 3)); | one, two, few, other |
| Sèbyen (Sirilik) | sr | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); | one, few, other |
| Slovak | sk | nplurals=3; plural=(n == 1) ? 0 : ((n >= 2 && n <= 4) ? 1 : 2); | one, few, other |
| Slovenyen | sl | nplurals=4; plural=(n % 100 == 1) ? 0 : ((n % 100 == 2) ? 1 : ((n % 100 == 3 || n % 100 == 4) ? 2 : 3)); | one, two, few, other |
| Panyòl | es | nplurals=2; plural=(n != 1); | one, other |
| Syedwa | sv | nplurals=2; plural=(n != 1); | one, other |
| Tay | th | nplurals=1; plural=0; | other |
| Tik | tr | nplurals=2; plural=(n != 1); | one, other |
| Ikrèn | uk | nplurals=3; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2); | one, few, many |
| Vyetnamyen | vi | nplurals=1; plural=0; | other |
Sa egzekisyon reyèl la te jwenn
Fòm zewo ak de nan lang Arab la te refize nan premye tan paske yo pa te genyen %(n)s. Yon fòm pou yon sèl nimewo ka fè sa, epi fòm de nan lang Arab la di "de" pou kont li, men tcheke nou an te konnen sèlman %d ak {count} kòm kont la. Kounye a li konnen %(n)s ak %(count)d Python tou, sa vle di tou yon "one" Ris san nimewo a refize, paske "one" Ris la se 21 ak 31 tou. Menm egzekisyon an te fè modèl la li tradiksyon li yo pou sans, epi li te kenbe "Unsubscribe" Tchèk ki te ekri kòm "log out".
Kote li ye
Polyglot 1.4.0 ekri tèt sa yo nan chak fichye .po li pwodui epi li mete chak fòm nan plas li. Poukisa yon fòm itilize pou plizyè nimewo dwe montre nimewo a se nan yon nòt anvan, epi tcheke yo menm yo gratis nan translation-checks, ki depi 1.3.0 li li yon fichye .po ou deja genyen epi li di lè Plural-Forms li a mete nimewo nan yon sèl plas ke CLDR bay fòm diferan.