Re: problem with plural-forms

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>
Subject: Re: problem with plural-forms
Date: 2009-05-26 14:05:35
Message-ID: 20090526140535.GB32650@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-05-26 14:09:01 Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)
Previous Message Dave Page 2009-05-26 13:55:55 Re: generic options for explain