Gevik Babakhani wrote: > > > > Surely it should be the inverse of the solution for output, > > eg TMMon selects localized input. > > > > After some investigation in how gettext works, I would like to have your > opinion about how to > implement this TODO item. > > Starting with TO_CHAR: > > When the TM prefix is used in TO_CHAR (for example TMMonth), > the routine, internally calls functions like the localize_month and > localize_day to get the localized value. > These functions rely on the current locale category that is internally > loaded by GetText "engine". > The GetText engine does not load any other locate category unless SET > LC_MESSAGES or alike is given. > > > Now back to TO_DATE: > > For this there are three solution that I can think of. > > 1. For TO_DATE to return localized data we can implement the TM prefix logic > which is already > implemented in TO_CHAR. Copying and modifying it for TO_DATE should be > feasible. > The downside of this solution is that TO_DATE will only return localized > values base on current locale. (no third parameter)
I can't remember anyone asking for more sophisticated solutions so it seems implementing #1 at this point is the best approach. -- Bruce Momjian <[EMAIL PROTECTED]> http://momjian.us EnterpriseDB http://postgres.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly