Re: NLS: use gettext() to translate system error messages
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Álvaro Herrera <alvherre@kurilemu.de>, pgsql-hackers@postgresql.org
Date: 2025-12-26T19:32:30Z
Lists: pgsql-hackers
On Tue, 2025-12-23 at 15:07 -0500, Tom Lane wrote: > This surprises me, because pg_locale.c sets LC_MESSAGES "for real" > precisely so that strerror() will see it. Isn't LC_MESSAGES also necessary for gettext()? If it's only strerror() we care about, then we could use uselocale() instead, because the platforms that don't support uselocale() also don't seem to do translation in strerror(). (I think only glibc translates through strerror(), though I've seen hints that Solaris may also.) Regards, Jeff Davis