Linked Questions
48 questions linked to/from How can I determine a user's locale within the browser?
542
votes
26
answers
715k
views
JavaScript for detecting browser language preference [duplicate]
I have been trying to detect the browser language preference using JavaScript.
If I set the browser language in IE in Tools>Internet Options>General>Languages, how do I read this value using ...
45
votes
3
answers
85k
views
Get visitors language & country code with javascript (client-side) [duplicate]
Question: Is there a javascript (client-side) code to get visitors country/language code, that is accurate and is cross-"modern"-browser ? I am looking for results like 'en-US', 'sv-SE', 'nl-NL', etc.
...
0
votes
1
answer
205
views
Get operating system language in a JSP [duplicate]
I would like to know if can get the language of a client operating system from a JSP and how to do it?
2774
votes
52
answers
2.3m
views
How to format a number with commas as thousands separators?
I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show the number 1234567 as "1,234,567". How would I go about doing this?
Here is how ...
171
votes
27
answers
383k
views
Get Locale Short Date Format using javascript
Is there anyway we can know using JavaScript the Short Date Format used in the Control Panel -> Regional and Language Settings?
I know the using the combination of following we can get the Locale ...
23
votes
6
answers
42k
views
Is there anyway to detect OS language using javascript?
I need to detect OS language using javascript so I can view my page depending on the language.
I know that we can detect the browser language but that is not enough for me.
I need Operation System ...
12
votes
4
answers
60k
views
Angular2 - Setting date field on reactive form
I have a component that uses two date fields, a start date & and end date.
By default, I have my end date field disabled and I toggle it when they select a start date.
this.transitionForm = this....
24
votes
2
answers
51k
views
Get current locale of Chrome
I am determining the current locale of the browser using this API:
var language = window.navigator.userLanguage || window.navigator.language;
This return "fr-FR" in IE, but it returns just "fr" in ...
16
votes
4
answers
30k
views
Detect a language of a string in node.js
I use a function from GitHub to my project.
Function sends a welcome email when a new user signs up and a goodbye email when user accounts are deleted. The function is loading to Firebase Cloud ...
14
votes
3
answers
31k
views
CultureInfo in JavaScript
In c# I use the below method in order to get the CultureInfo.
System.Globalization.CultureInfo.CurrentCulture.Name // output :en-US
Can any one tell me how can I get the CultureInfo in JavaScript?
13
votes
2
answers
26k
views
Javascript users incorrect locale with date formatting
In javascript I'm using Date.toLocaleDateString to format my dates in the user's locale. While in theory it should work, it doesn't.
I am located in the UK. My computer is set to UK and my default ...
8
votes
1
answer
15k
views
Javascript - get current locale using Intl to display time and date
I want my webpage to display date and time in user's locale.
It seems Intl is supported by most browsers now (see Can I Use Intl). I can acquire browser time zone just fine by using Intl....
1
vote
4
answers
3k
views
How to find out the dimensionality of print paper in javascript
I am generating reports in HTML formats, and want to print them automatically using Qt (qt has a webkit based browser, and one can render its contents to a PDF file).
I want to position the elements ...
-1
votes
2
answers
4k
views
Translate text in Alert Box
I have a alert message,
alert('Hi')
it prints, Hi in the alert window.
I want that message Hola to be printed when someone whose IE is set to Spanish.
How can I go about doing that please?
Thank ...
3
votes
1
answer
4k
views
Determine the Accept-Language HTTP request header using Javascript — or otherwise determine the user’s preferred language(s)
I'd like use Javascript to find out my browser's default HTTP Accept-Language that it sends in an HTTP request. I'm aware that Javascript's XMLHTTPRequest Object has a getResponseHeader() method. Does ...