Skip to content

Instantly share code, notes, and snippets.

@nadeesha
Created May 17, 2019 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadeesha/1a726f1430d381f0186e9cab8f9f54c7 to your computer and use it in GitHub Desktop.
Save nadeesha/1a726f1430d381f0186e9cab8f9f54c7 to your computer and use it in GitHub Desktop.
function setUserLanguageCode(selectedLanguage) {
const languageCode = getLanguageCode(selectedLanguage);
let storedSuccessfully;
try {
window.localStorage.setItem("LANG_CODE", languageCode);
storedSuccessfully = true;
} catch (e) {
storedSuccessfully = false;
}
return {
storedSuccessfully
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment