Re: libpq messages language

From: Efraín López <tecnomaya(at)cabsagt(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: libpq messages language
Date: 2007-12-06 03:03:46
Message-ID: 000901c837b4$a0e12610$0401a8c0@TOSHIBA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for your reply

but I got the error 'LC_MESSAGES' : undeclared identifier

locale.h only defines LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME

I tried to set a system variable LC_MESSAGES, but didn't work

Then, I tried to find more information

In libpq, when ENABLE_NLS is not defined,
#define libpq_gettext(x) (x)

If I set ENABLE_NLS to 1, then I think I need the gettext library, because
it needs <libintl.h>

so, there is no simple way in windows to get messages in spanish within
libpq before connecting to server, is correct?

thanks

----- Original Message -----
From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Efraín López *EXTERN*" <tecnomaya(at)cabsagt(dot)com>;
<pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, December 04, 2007 5:33 AM
Subject: RE: [GENERAL] libpq messages language

Efraín López wrote:
> I am using Windows, and pg 8.2.5
>
> When making a connection with libpq, if it fails I would like
> to get the errors messages in spanish (PQerrorMessage )
>
> Is this possible? How can this be done?

Set the program's locale prior to calling libpq functions.

I did not try it on Windows, but Microsoft seems to work like
UNIX in that respect:

http://msdn2.microsoft.com/en-us/library/x99tb11d(VS.80).aspx

Try something like

setlocale(LC_MESSAGES, "Spanish");

or, if your language environment is Spanish, simply

setlocale(LC_MESSAGES, "");

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2007-12-06 03:09:57 Re: WAL shipping question
Previous Message Michael Glaesemann 2007-12-06 01:23:16 Re: storage size of "bit" data type..