Re: A couple of gripes about the gettext plurals patch

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: A couple of gripes about the gettext plurals patch
Date: 2009-05-20 23:46:25
Message-ID: 200905210246.26376.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-05-20 23:47:54 Re: Compiler warning
Previous Message Steve Prentice 2009-05-20 23:38:41 Re: plpgsql + named parameters