diff --git a/source/javascripts/app/lang.js b/source/javascripts/app/lang.js index ae18b9c..0029901 100644 --- a/source/javascripts/app/lang.js +++ b/source/javascripts/app/lang.js @@ -41,6 +41,9 @@ under the License. hash = hash.replace(/^#+/, ''); } history.pushState({}, '', '?' + language + '#' + hash); + + // save language as next default + localStorage.setItem("language", language); } function setupLanguages(l) { @@ -53,7 +56,6 @@ under the License. // the language is in the URL, so use that language! activateLanguage(location.search.substr(1)); - // set this language as the default for next time, if the URL has no language localStorage.setItem("language", location.search.substr(1)); } else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) { // the language was the last selected one saved in localstorage, so use that language!