Current Browser User Language or Culture?

B

bradwiseathome

In pure JavaScript, how can I know what language/culture the user is
currently in? So I could display a page with a dollar sign if USA but
a pound symbol if GBR, for example.

Thanks.
 
R

Randy Webb

(e-mail address removed) said the following on 6/22/2007 11:57 AM:
In pure JavaScript, how can I know what language/culture the user is
currently in?

The language won't tell you much as it doesn't differentiate between
cultures/dialects.

navigator.language
So I could display a page with a dollar sign if USA but
a pound symbol if GBR, for example.

While the goal is admirable it is more trouble than it is worth and very
undependable. Put a select list and let the user choose what currency.

If an American is traveling in Italy and visits your site, should they
get Italian or US Currency? Of all the visits to Italy, I have possessed
Italian currency once. I always use US Dollars (even though I know it
costs me money).
 
C

Cenc

In pure JavaScript, how can I know what language/culture the user is
currently in? So I could display a page with a dollar sign if USA but
a pound symbol if GBR, for example.

I use this: navigator.userLanguage

But it doesn't work with FF.

Is there a way to retrieve the system language with FF?
 
L

Lee

Cenc said:
I use this: navigator.userLanguage

But it doesn't work with FF.

Is there a way to retrieve the system language with FF?

Did you happen to read the rest of this thread?


--
 
C

Cenc

If an American is traveling in Italy and visits your site, should they
get Italian or US Currency? Of all the visits to Italy, I have possessed
Italian currency once. I always use US Dollars (even though I know it
costs me money).

I think he means the same as me: If a german user (usually on a german
computer with german system language) visits the site, the text /
signs should be what a german would expect / prefer to see: Euro

if (german) €
if (usa) $
if (swedish) sek
if (GB) £
if (french) €
and so on ..........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top