Page 1 of 1
Set Language
Posted: Mon Nov 21, 2005 6:21 am
by Enga
Hi!
I wanted to set the language to portuguese in php so when i use the function getdate() i would get the
day of the week and the month in portuguese.
Is there any function for that?
Any help would be apreciated.
Thanks
Enga
Posted: Mon Nov 21, 2005 7:09 am
by Maugrim_The_Reaper
http://ie2.php.net/manual/hk/function.setlocale.php
...is as close as it gets for simple stuff.
Unfortunately for actual day/month names you are better off using substitution - replacing the english names with their portuguese equivalents. Many translation schemes utilise such replacement outside the native PHP functions. I'd suggest reading up on internationalisation and localisation (internationalization/localization for US websites) for more information on the whys and hows...
Posted: Mon Nov 21, 2005 7:09 am
by twigletmac
Try a combination of
setlocale() and
strftime() - there's a bunch of examples on the strftime() page.
Mac
Posted: Mon Nov 21, 2005 7:49 am
by yum-jelly
I would just make shift function so you can support all the date functions and also maintain punctuation, capitulation which setlocale() does not do! Punctuation, capitulation is only maintained for the system installed locale!
yj