Re: Day and month name localization uses wrong
От | Bruce Momjian |
---|---|
Тема | Re: Day and month name localization uses wrong |
Дата | |
Msg-id | 200611242320.kAONKNs21902@momjian.us обсуждение исходный текст |
Ответ на | Re: Day and month name localization uses wrong locale category (Euler Taveira de Oliveira <euler@timbira.com>) |
Список | pgsql-hackers |
It is too close to the RC1 release to apply this patch. I have added documentation that "TM"'s locale is controlled by "lc_messages". This has been saved for the 8.3 release: http://momjian.postgresql.org/cgi-bin/pgpatches_hold --------------------------------------------------------------------------- Euler Taveira de Oliveira wrote: > 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, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.346 diff -c -c -r1.346 func.sgml *** doc/src/sgml/func.sgml 20 Nov 2006 20:20:18 -0000 1.346 --- doc/src/sgml/func.sgml 24 Nov 2006 23:18:59 -0000 *************** *** 4689,4695 **** </row> <row> <entry><literal>TM</literal> prefix</entry> ! <entry>translation mode (print localized day and month names)</entry> <entry><literal>TMMonth</literal></entry> </row> <row> --- 4689,4695 ---- </row> <row> <entry><literal>TM</literal> prefix</entry> ! <entry>translation mode (print localized day and month names based on <varname>lc_messages</>)</entry> <entry><literal>TMMonth</literal></entry> </row> <row> Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.346 diff -c -c -r1.346 func.sgml *** doc/src/sgml/func.sgml 20 Nov 2006 20:20:18 -0000 1.346 --- doc/src/sgml/func.sgml 24 Nov 2006 23:18:59 -0000 *************** *** 4689,4695 **** </row> <row> <entry><literal>TM</literal> prefix</entry> ! <entry>translation mode (print localized day and month names)</entry> <entry><literal>TMMonth</literal></entry> </row> <row> --- 4689,4695 ---- </row> <row> <entry><literal>TM</literal> prefix</entry> ! <entry>translation mode (print localized day and month names based on <varname>lc_messages</>)</entry> <entry><literal>TMMonth</literal></entry> </row> <row>
В списке pgsql-hackers по дате отправления: