javascript get user preferred language
snippet in javascript

javascript get user preferred language

user9172

//detect the language preference of the user's browser
var userLanguage = window.navigator.userLanguage || window.navigator.language;