Re: NLS: use gettext() to translate system error messages

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: NLS: use gettext() to translate system error messages
Date: 2025-12-26 19:32:30
Message-ID: b2437530dd2df9b4f33a3bd000223bc592e11fae.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-12-26 19:33:21 Re: NLS: use gettext() to translate system error messages
Previous Message Pavel Stehule 2025-12-26 18:12:46 Re: 17f446784d54da827f74c2acc0fa772a41b92354 breaks orafce build