A couple of gripes about the gettext plurals patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема A couple of gripes about the gettext plurals patch
Дата
Msg-id 21740.1240770560@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: A couple of gripes about the gettext plurals patch  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
I see that the recently committed changes typically use ngettext
in this style:
       ereport(msglevel,               /* translator: %d always has a value larger than 1 */
(errmsg(ngettext("dropcascades 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.

A simple fix would be to use errmsg_internal() in these cases, but I
wonder if we should instead invent nerrmsg() or something like that.
Anyway, there are some other usages besides errmsg(ngettext()) that
are broken in the same way and will also require consideration.

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?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Valtonen, Hannu"
Дата:
Сообщение: Re: Patch to add support for text/int arrays for plpythonu
Следующее
От: Andrej
Дата:
Сообщение: Re: RFE: Transparent encryption on all fields