Removing %n in plural i18n calls

Stephan Kulow coolo at kde.org
Mon Feb 12 10:49:45 GMT 2007


Am Montag, 12. Februar 2007 11:37 schrieb Olaf Schmidt:
> [ Chusslove Illich, Mo., 12. Feb. 2007 11:05 ]
>
> > Also, it doesn't have to be %1 which is plural number, but the first
> > argument which is an integer of some sort will be used as such.
>
> What happens with sentences that have two numbers that can each be plural?
> Are developers asked to reformulate this to two separate sentences?
They always have been. With english or german it would already be complex 
enough to formulate the translations

msgid[0] "One developer fixes a bug"
msgid[1] "%n developers fix a bug"
msgid[2] "One developer fixes %n bugs"
msgid[3] "%n developers fix %n bugs"

(I fixed 10 typos while I texted this example :)

Now that makes 9 msgstr for Russian, Polish and several other slavic 
languages. 16 msgstr for Slovenian, Arabic or Maltese and not less than
25 for Gaeilge. 

Here is the Plural line to pick the msgstr if there is one %n:
nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n < 11 ? 3 : 4";

I leave the math how to pick the right msgstr for two %n to someone else.

Greetings, Stephan




More information about the kde-core-devel mailing list