Re: [pgtranslation-translators] on gettext plural support - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [pgtranslation-translators] on gettext plural support
Date
Msg-id 200904122040.32164.peter_e@gmx.net
Whole thread Raw
In response to Re: [pgtranslation-translators] on gettext plural support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sunday 12 April 2009 18:06:48 Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > I don't think there is much you can do here.  Either leave it out, or
> > write "CANNOT HAPPEN", or just translate normally.
>
> But Alvaro's complaint that the current coding is incorrect for English
> still stands, no?  Or does ngettext choose the second string for n = 0?

In English (i.e., the default case), ngettext chooses the second/plural string 
for zero.  In other languages, it chooses whatever string you configure.  For 
example, in Spanish the recommended formula is

Plural-Forms: nplurals=2; plural=n != 1;

which is the same as in English.  In French and Brazilian Portuguese, the 
recommended formula is

Plural-Forms: nplurals=2; plural=n>1;

which means that zero uses the singular form.  So those guys should also 
translate msgstr[0] with the expectation of it being used, because n==0 can 
happen, even if n==1 cannot.


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_restore dependencies
Next
From: Dimitri Fontaine
Date:
Subject: Re: Closing some 8.4 open items