bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] Plural rule definitions


From: Michele Locati
Subject: Re: [bug-gettext] Plural rule definitions
Date: Wed, 11 Feb 2015 08:29:57 +0100

2015-02-11 1:40 GMT+01:00 Daiki Ueno <address@hidden>:
Michele Locati <address@hidden> writes:

> I just finished a little tool that converts the plural rules from the
> CLDR format to the gettext format.

Looks like a useful tool.  Perhaps msginit (plural-table.c) could use
the generated data.

Yes, that would lead to a more complete languages table. I can easily add a new option to automatically generate the plural_table.
BTW, do you think it could be possible to add more infos to that table? I mean, currently gettext offers the number of plurals and the formula to distinguish between them, but the only way to know the meaning of the different plural cases is to inspect the formula.
What about adding the CLDR names of the cases and their relative examples? I think that it could help many people if the gettext headers could be extended to something like this:
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=(n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((n % 100 >= 3 && n % 100 <= 10) ? 3 : ((n % 100 >= 11 && n % 100 <= 99) ? 4 : 5))));\n"
"Plural-Case-0: name=zero; examples=0;\n"
"Plural-Case-1: name=one; examples=1;\n"
"Plural-Case-2: name=two; examples=2;\n"
"Plural-Case-3: name=few; examples=3~10, 103~110, 1003, …;\n"
"Plural-Case-4: name=many; examples=11~26, 111, 1011, …;\n"
"Plural-Case-5: name=other; examples=100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, …;\n"
 

By the way, do you mind if we mention that page (and also your Windows
binaries page) from the manual and/or the web page?

Sure! That could be helpful in many cases.


Ciao!
--
Michele

reply via email to

[Prev in Thread] Current Thread [Next in Thread]