Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Get the language of a user

const getNavigatorLanguage = () => {
  if (navigator.languages && navigator.languages.length) {
    return navigator.languages[0];
  } else {
    return navigator.userLanguage || navigator.language || navigator.browserLanguage || 'en';
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Get #language #user
ADD COMMENT
Topic
Name
8+1 =