For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2005 > getting default country_locale









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author getting default country_locale
Ike

2005-04-19, 3:56 pm

Is anyone aware of a means to determine the default country_local (the
iso-spec, e.g. 'en_US') for a given LOCAL computer, such as someone might
have specified in Windows under Control Panel - Regional and Language
Options ?


Kimmo Laine

2005-04-20, 8:55 am

"Ike" <rxv@hotmail.com> wrote in message
news:hy79e.8828$An2.2200@newsread2.news.pas.earthlink.net...
> Is anyone aware of a means to determine the default country_local (the
> iso-spec, e.g. 'en_US') for a given LOCAL computer, such as someone might
> have specified in Windows under Control Panel - Regional and Language
> Options ?
>


$_SERVER['HTTP_ACCEPT_LANGUAGE'] gives you the language set in the UA.
Also
$_SERVER['HTTP_USER_AGENT']:Mozilla/5.0 (Windows; U; Windows NT 5.1; fi-FI;
rv:1.7.7) Gecko/20050414 Firefox/1.0.3
fi-FI is mentioned. That should be fi_FI for Finnish, but anyway... Although
Firefox seems to be the only one from Ie, Fx and Opera that sends the
language code in the user agent description. So what ever you get, it's
never more than a mere guess what the language might be, and so you should
provide the user with a possibility to change the language if necessary.

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com


Ike

2005-04-20, 3:56 pm



"Kimmo Laine" <eternal.erectionN05P@Mgmail.com> wrote in message
news:wqn9e.8761$wj6.7251@reader1.news.jippii.net...
> "Ike" <rxv@hotmail.com> wrote in message
> news:hy79e.8828$An2.2200@newsread2.news.pas.earthlink.net...
might[color=darkred]
>
> $_SERVER['HTTP_ACCEPT_LANGUAGE'] gives you the language set in the UA.
> Also
> $_SERVER['HTTP_USER_AGENT']:Mozilla/5.0 (Windows; U; Windows NT 5.1;

fi-FI;
> rv:1.7.7) Gecko/20050414 Firefox/1.0.3
> fi-FI is mentioned. That should be fi_FI for Finnish, but anyway...

Although
> Firefox seems to be the only one from Ie, Fx and Opera that sends the
> language code in the user agent description. So what ever you get, it's
> never more than a mere guess what the language might be, and so you should
> provide the user with a possibility to change the language if necessary.



Thanks Kimmo. What is "UA," represent, as in "...language set in the
UA?" -Ike


Kimmo Laine

2005-04-20, 3:56 pm

"Ike" <rxv@hotmail.com> wrote in message
news:Tnr9e.11120$lP1.854@newsread1.news.pas.earthlink.net...
>
>
> "Kimmo Laine" <eternal.erectionN05P@Mgmail.com> wrote in message
> news:wqn9e.8761$wj6.7251@reader1.news.jippii.net...
> might
> fi-FI;
> Although
>
>
> Thanks Kimmo. What is "UA," represent, as in "...language set in the
> UA?" -Ike
>



User Agent - fancy word for browser.

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com


Ike

2005-04-20, 3:56 pm


>
>
> User Agent - fancy word for browser.
>


Thanks Kimmo. This is EXACTLY what I was looking for! -Ike


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com