Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-28 Thread Peter Eisentraut
On Thursday 28 May 2009 00:54:32 Tom Lane wrote: To wit, the current coding fails to respect the gettext domain when working with pluralized messages. The ngettext() calls use the default textdomain that main.c sets up. The PLs use dngettext(). Is that not correct? -- Sent via

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-28 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Thursday 28 May 2009 00:54:32 Tom Lane wrote: To wit, the current coding fails to respect the gettext domain when working with pluralized messages. The ngettext() calls use the default textdomain that main.c sets up. The PLs use dngettext(). Is

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-27 Thread Bruce Momjian
Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: I tried throwing various kinds of subtle garbage into the errmsg/ngettext line, but it was all discovered by gcc -Wall. I experimented with this and found that indeed both format strings are checked ... if you have a reasonably

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-27 Thread Peter Eisentraut
On Tuesday 26 May 2009 21:05:29 Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: I tried throwing various kinds of subtle garbage into the errmsg/ngettext line, but it was all discovered by gcc -Wall. I experimented with this and found that indeed both format strings are checked

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-27 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Tuesday 26 May 2009 21:05:29 Tom Lane wrote: I experimented with this and found that indeed both format strings are checked ... if you have a reasonably recent libintl.h AND you have specified --enable-nls. Otherwise it all goes to heck, apparently

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-27 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Tuesday 26 May 2009 21:05:29 Tom Lane wrote: I experimented with this and found that indeed both format strings are checked ... if you have a reasonably recent libintl.h AND you have specified --enable-nls. Otherwise it all goes to heck, apparently

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-26 Thread Peter Eisentraut
On Monday 25 May 2009 22:02:47 Tom Lane wrote: The issue of double translation is really a minor point; what is bothering me is that we've got such an ad-hoc, non-compile-time-checkable approach here. Zdenek's discovery today that some of the format strings are flat-out wrong

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-26 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: I tried throwing various kinds of subtle garbage into the errmsg/ngettext line, but it was all discovered by gcc -Wall. I experimented with this and found that indeed both format strings are checked ... if you have a reasonably recent libintl.h AND you

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-25 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Sunday 26 April 2009 21:29:20 Tom Lane wrote: 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

Re: [HACKERS] A couple of gripes about the gettext plurals patch

2009-05-20 Thread Peter Eisentraut
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,

[HACKERS] A couple of gripes about the gettext plurals patch

2009-04-26 Thread Tom Lane
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(drop cascades to %d other object, drop cascades to %d