Skip to content

Instantly share code, notes, and snippets.

@brennandunn
Created March 23, 2020 22:39
Show Gist options
  • Save brennandunn/6b254eca47188af0c4e9c778eaed1cdc to your computer and use it in GitHub Desktop.
Save brennandunn/6b254eca47188af0c4e9c778eaed1cdc to your computer and use it in GitHub Desktop.
<script>
var lang = window.navigator.userLanguage || window.navigator.language;
lang = lang.slice(3, 5);
if (lang) lang = lang.toLowerCase();
window.userLanguage = lang;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment