Re: Day and month name localization uses wrong locale category

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Day and month name localization uses wrong locale category
Date: 2006-11-20 23:52:57
Message-ID: 20061120235257.GA2996@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:

> > What about using strftime()? So we couldn't worry about gettext
> > translations; "all" is localized.
> > Why didn't I think it before? :-)
> >
> > I'll try to code a patch today later if noone objects.
>
> How is this going?
>
Finished. Sorry for the delay I had some trouble understanding how
backend treats the locale stuff (Neil pointed out the path).
Now TM mode is returning strftime() output. It would be nice if in the
future we change this to pg_strftime() but unfortunately the last one is
not i18n. :(

template1=# show lc_time;
lc_time
---------
pt_BR
(1 registro)

template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
to_char
---------------------------
Segunda, 20 Novembro 2006
(1 registro)

template1=# set lc_time to 'C';
SET
template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
to_char
--------------------------
Monday, 20 November 2006
(1 registro)

template1=# set lc_time to 'de_DE';
SET
template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
to_char
--------------------------
Montag, 20 November 2006
(1 registro)

template1=#

Comments?

--
Euler Taveira de Oliveira
http://www.timbira.com/

Attachment Content-Type Size
tm.diff text/plain 14.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-11-20 23:57:59 Re: Day and month name localization uses wrong locale category
Previous Message Simon Riggs 2006-11-20 23:18:56 Re: Custom Data Type Question