Fixed issue with browsers with no language set.

This commit is contained in:
Giulio Cesare Solaroli 2015-09-10 21:38:57 +02:00
parent e161d4d46b
commit 94661db83d

View File

@ -272,7 +272,7 @@ Clipperz.PM.Strings.Languages.initSetup = function() {
var language;
var languageParser;
language = navigator.language || navigator.userLanguage; // en, en-US, .... "de", "nb-no"
language = navigator.language || navigator.userLanguage || 'en'; // en, en-US, .... "de", "nb-no"
languageParser = new RegExp("language=([a-z]{2}(?:\-[a-z]{2})?)(\&|$)", "i");
if (languageParser.test(window.location.search)) {
language = RegExp.$1;