Re: A couple of gripes about the gettext plurals patch - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: A couple of gripes about the gettext plurals patch
Date
Msg-id 200905210246.26376.peter_e@gmx.net
Whole thread Raw
In response to A couple of gripes about the gettext plurals patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A couple of gripes about the gettext plurals patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sunday 26 April 2009 21:29:20 Tom Lane wrote:
>         ereport(msglevel,
>                 /* translator: %d always has a value larger than 1 */
>                 (errmsg(ngettext("drop cascades to %d other object",
>                                  "drop cascades to %d other objects",
>                                  numReportedClient + numNotReportedClient),
>                         numReportedClient + numNotReportedClient),
>
> This is bogus: errmsg expects that it should itself feed its first
> argument through gettext(), not receive an argument that is already
> translated.  That's at the least a waste of cycles, and it's not
> entirely impossible that double translation could end up with a just
> plain wrong result.

I think we can live with this for now, and we have lived with this sort of 
issue in other places for a while.  We should consider reshuffling the 
interfaces a bit as you describe to reduce the problem.  But I think this is 
not something we always avoid completely.

> I'm also wondering whether PGAC_CHECK_GETTEXT() should be made to
> check for ngettext() instead of bind_textdomain_codeset().  Which
> one was added later?

I checked this in the gettext changelog, and bind_textdomain_code() came 
(slightly) later, so we're OK.


pgsql-hackers by date:

Previous
From: Steve Prentice
Date:
Subject: Re: plpgsql + named parameters
Next
From: Peter Eisentraut
Date:
Subject: Re: Compiler warning