Re: problem with plural-forms - Mailing list pgsql-hackers

From Tom Lane
Subject Re: problem with plural-forms
Date
Msg-id 10794.1243345664@sss.pgh.pa.us
Whole thread Raw
In response to Re: problem with plural-forms  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: problem with plural-forms  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: problem with plural-forms  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On Monday 25 May 2009 19:11:24 Zdenek Kotala wrote:
>> The problem here is (1 row) instead of (%lu row). When I run msgfmt
>> without -v everything works fine but I think we should fixed it (there
>> are more occurrences of this issue).

> GNU gettext accepts this, and in fact the GNU gettext documentation explicitly 
> points out that this allowed:

>      In the English singular case, the number - always 1 - can be
>      replaced with "one":

>           printf (ngettext ("One file removed", "%d files removed", n), n);

>      This works because the `printf' function discards excess arguments
>      that are not consumed by the format string.

That advice is, if not outright wrong, at least incredibly
short-sighted.  The method breaks the instant you have any additional
values to print.  For example, this ain't gonna work:
      printf (ngettext ("One file removed, containing %lu bytes",                        "%d files removed, containing
%lubytes", n),              n, total_bytes);
 

I'm of the opinion that the test being performed by msgfmt -v is
entirely reasonable, and we should not risk such problems for the sake
of sometimes spelling out "one".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)
Next
From: Andrew Dunstan
Date:
Subject: Re: generic options for explain