ANTON072
1/23/2015 - 11:59 AM

Language detection in javascript

Language detection in javascript

window.navigator.language        // -> "fr-fr"
window.navigator.languages       // -> undefined
window.navigator.userLanguage    // -> undefined
window.navigator.browserLanguage // -> undefined
window.navigator.systemLanguage  // -> undefined
window.navigator.language        // -> 'en-US'
window.navigator.languages       // -> undefined
window.navigator.userLanguage    // -> 'en-US'
window.navigator.browserLanguage // -> 'en-US'
window.navigator.systemLanguage  // -> 'en-US'
window.navigator.language        // -> undefined
window.navigator.languages       // -> undefined
window.navigator.userLanguage    // -> 'en-US'
window.navigator.browserLanguage // -> 'en-US'
window.navigator.systemLanguage  // -> 'en-US'
window.navigator.language        // -> undefined
window.navigator.languages       // -> undefined
window.navigator.userLanguage    // -> 'en-us'
window.navigator.browserLanguage // -> 'en-us'
window.navigator.systemLanguage  // -> 'en-us'
window.navigator.language        // -> "fr"
window.navigator.languages       // -> [ "fr", "fr-FR", "en-US", "en" ]
window.navigator.userLanguage    // -> undefined
window.navigator.browserLanguage // -> undefined
window.navigator.systemLanguage  // -> undefined
window.navigator.language        // -> "fr"
window.navigator.languages       // -> ["fr-FR", "fr", "en-US", "en", "es", "de"]
window.navigator.userLanguage    // -> undefined
window.navigator.browserLanguage // -> undefined
window.navigator.systemLanguage  // -> undefined