Re: gettext, plural form and translation

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Sergey Burladyan <eshkinkot(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: gettext, plural form and translation
Date: 2009-03-19 15:06:30
Message-ID: 49C25F76.3030604@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aidan Van Dyk wrote:
> * Peter Eisentraut <peter_e(at)gmx(dot)net> [090319 04:21]:
>
>> It depends also on what we *want* to target. I originally omitted the
>> plural support because it was a GNU extension, and I wanted to support
>> "standard" gettext implementations as well. (There was also a licensing
>> consideration.) Solaris is the "original" implementation of this API,
>> so it can serve as a reference point.
>>
>> But it is open to debate whether that decision is more useful than the
>> tradeoff it imposes.
>
> Of course, ngettext can easily be "ported", at it's most basic level
> (equivalent to GNU's C locale implentation) it's:
>
> #ifdef NEED_NGETTEXT
> #define ngettext(s,p,n) gettext((n)==1?(s):(p))
> #endif

The more interesting question is whether such a msgfmt will correctly
process message catalogs containing things like

#: print.c:2351
#, c-format
msgid "(1 row)"
msgid_plural "(%lu rows)"
msgstr[0] "(1 Zeile)"
msgstr[1] "(%lu Zeilen)"

My guess is not.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-03-19 19:49:23 Re: Extension of Thick Indexes
Previous Message Aidan Van Dyk 2009-03-19 13:54:40 Re: gettext, plural form and translation