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