Thanks to
Nissai for this one. Maybe it’s old news to some of you but including SetLocale in the language file allow for date localization, site wide
Example for
francais.inc.php :
setlocale (LC_ALL, 'fr_FR');
Refer to
SetLocale doc to set your country’s code.
I think we should all add this to the language file, so that users don’t have to do anything about date localization.
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I just want to point that this is not thread safe and the number representation will work differently for mysql or search string when the setlocal is activated.
Yeap, I would like to know more about this.
I can see the use of this on the type of ASP .Net application, but for PHP, I still think ther eis a limitation. When we setlocale, what function does this thing affect, and how about mysql processing and etc.
Any further info about this will be great, considering I’m still new to this kind of thing on PHP.
Thanks
-
☆ A M B ☆
- 24,524 Posts
http://il2.php.net/setlocale
A lot of comments discussing this.
Quote from: OpenGeek at Feb 28, 2006, 02:01 PM
Great stuff -- can we make sure that gets a task in the tracker David? Just so we can keep track of such great feature enhancements. 
I sure can, and
I’ll do it right now so that I don’t forget. Done
We have to check if this causes any problem though...
Edit : Followed Susan’s link, there is indeed a Warning as Chanh said :
WarningThe locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server api like IIS or Apache on Windows you may experience sudden changes of locale settings while a script is running although the script itself never called setlocale() itself. This happens due to other scripts running in different threads of the same process at the same time changing the processwide locale using setlocale().
It would only create problem on Windows environment if I understand correctly...
Wouldn’t there be a way to have Windows environment ignore those lines (like an escape syntax or whatever) ?
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Wendy, do you sleep sometimes

?!? You’re on so many front it sure looks like you don’t...
Anyway, nice to know you’re looking into it !
Don’t go the complicated way though if it can be avoided then be lazy
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id