473,466 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Current Browser User Language or Culture?

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.

Jun 22 '07 #1
4 9495
br************@hotmail.com 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).

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 22 '07 #2
On Fri, 22 Jun 2007 08:57:17 -0700, br************@hotmail.com wrote:
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?
Jun 24 '07 #3
Lee
Cenc said:
>
On Fri, 22 Jun 2007 08:57:17 -0700, br************@hotmail.com wrote:
>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?
Did you happen to read the rest of this thread?
--

Jun 24 '07 #4
On Fri, 22 Jun 2007 12:26:32 -0400, Randy Webb
<Hi************@aol.comwrote:
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 ..........

Jun 24 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: Mountain Bikn' Guy | last post by:
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
5
by: Samuel | last post by:
Hi, I am running into a problem of mixing UICulture = auto and allowing users to select culture using a dropdown list. I am detecting a querystring, "setlang", and when found, setting the...
9
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
2
by: jeffmagill | last post by:
Hi everyone! As the title says, I'm to access the default culture for the browser at run time. Furthermore as some side notes, my application's goal is to accomplish this at the application...
20
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am...
3
by: laryten | last post by:
Hi, Is there a way to update the same web page instead of getting a new page each time we click the submit button? The simplest thing to do is to delete the current page (or go back to the...
3
by: dw | last post by:
stilHello... Is there a way to detect a person's time zone and/or country when they browse to a site? I want to dynamically display controls and labels based on the user's time zone or...
4
by: adi | last post by:
Hi I'm using .NET Framework 1.1 My application needs to read the system's language settings. How to do this? Thanks.
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.