use english is browser language is not set

This commit is contained in:
Hannes Mannerheim 2017-01-17 17:54:22 +01:00
parent 1c1b4b19e1
commit 41c1ad9ca4

View File

@ -750,6 +750,11 @@ $(window).load(function() {
// set language, from local storage, else browser language
var browserLang = navigator.language || navigator.userLanguage;
// use english if browser has no language set
if(typeof browserLang == 'undefined') {
var browserLang = 'en-GB';
}
// browsers report e.g. sv-SE but we want it in the format "sv" or "sv_se"
browserLang = browserLang.replace('-','_').toLowerCase();