Re: problem with plural-forms

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem with plural-forms
Дата
Msg-id 10794.1243345664@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: problem with plural-forms  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: problem with plural-forms  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: problem with plural-forms  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Zdenek Kotala
Дата:
Сообщение: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: generic options for explain