"Ike" <rxv@hotmail.co m> wrote in message
news:5Hc9e.1084 0$lP1.738@newsr ead1.news.pas.e arthlink.net...[color=blue]
> Is anyone aware of there exists a means in Javascript to determine the
> browser's default locale? Thanks, Ike[/color]
Not really.
There is navigator.langu age (Gecko-based browsers, Opera 8 and possibly
other browsers) and navigator.brows erLanguage (IE, Opera 8 and possibly
other browsers), but it's not particularly useful since it really
doesn't tell you anything about the person using the Web browser.
The best approach is to present a list of locales for the user to choose
from, then store that in a profile on the server, or in a cookie on the
client.
--
Grant Wagner <gwagner@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Ike wrote:
[color=blue]
> Is anyone aware of there exists a means in Javascript to determine the
> browser's default locale? Thanks, Ike
>
>[/color]
You can grab "Date().getTime zoneOffset()" and "navigator.lang uage"
("userLangua ge" IE) and make an educated guess.
Mick
Mick White wrote:
[color=blue]
> Ike wrote:[color=green]
>> Is anyone aware of there exists a means in Javascript to determine the
>> browser's default locale? Thanks, Ike[/color]
>
> You can grab "Date().getTime zoneOffset()" and "navigator.lang uage"
> ("userLangua ge" IE) and make an educated guess.[/color]
And even that would accomplish nothing. You never know if it is a French
user working with a German browser locale using a keyboard with Italian
layout in Switzerland. Ask users about the interface language they desire
(by text link, not by flags) and you'll be correct always.
Comment