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

From Alvaro Herrera
Subject Re: problem with plural-forms
Date
Msg-id 20090526140535.GB32650@alvh.no-ip.org
Whole thread Raw
In response to Re: problem with plural-forms  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: problem with plural-forms
Re: problem with plural-forms
Re: problem with plural-forms
List pgsql-hackers
Tom Lane wrote:

> 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 %lu bytes", n),
>                n, total_bytes);

I think it should use the %2$s style specifier in that case.  This
should work:

>        printf (ngettext ("One file removed, containing %2$lu bytes",
>                          "%d files removed, containing %lu bytes", n),
>                n, total_bytes);

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: generic options for explain
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)