mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-04-23 19:40:21 +08:00
Fix default language selection bug
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user