Answers for "Get the language of a user"

0

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';
  }
}
Posted by: Guest on July-26-2021

Code answers related to "Get the language of a user"

Code answers related to "Javascript"

Browse Popular Code Answers by Language