-
-
Save jgillich/e55cfb283acae0f4eb45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locales = { | |
en: { | |
hello: 'Hello' | |
}, | |
de: { | |
hello: 'Hallo' | |
} | |
}; | |
var userLanguage = navigator.language.split('-')[0]; | |
var currentLocale = locales[userLanguage] || locales['en']; | |
console.log(currentLocale.hello); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment