use local storage to cache locale choice

This commit is contained in:
wixette
2020-03-08 16:55:36 +08:00
parent a15dd897ae
commit af9abdaf4f
2 changed files with 23 additions and 0 deletions

View File

@@ -553,6 +553,9 @@ panel.sim = null;
* Initializes thie UI.
*/
panel.init = function() {
// Restores the last locale if it exists.
l10n.restoreLocale();
// Initializes event listener for nav buttons.
var button = document.getElementById('locale');
button.addEventListener('click', l10n.nextLocale, false);