Skip to content

Instantly share code, notes, and snippets.

@mizrael
Created August 4, 2017 11:03
Show Gist options
  • Save mizrael/50c10be8ec92264751187d7705362eb2 to your computer and use it in GitHub Desktop.
Save mizrael/50c10be8ec92264751187d7705362eb2 to your computer and use it in GitHub Desktop.
How to detect current culture in javascript
/// 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