Created
August 4, 2017 11:03
-
-
Save mizrael/50c10be8ec92264751187d7705362eb2 to your computer and use it in GitHub Desktop.
How to detect current culture in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// https://stackoverflow.com/questions/25606730/get-current-locale-of-chrome#answer-42070353 | |
var language; | |
if (window.navigator.languages) { | |
language = window.navigator.languages[0]; | |
} else { | |
language = window.navigator.userLanguage || window.navigator.language; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment