Fix default language selection bug

This commit is contained in:
Robert Lord
2014-06-22 03:10:26 -07:00
parent 0f93ffcc2b
commit d1fdd685a6

View File

@@ -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!