Describe the bug
Local storage key "lang" not being respected
To Reproduce
Steps to reproduce the behavior:
Open webpage
Select a language
Lang is set in localstorage
Refresh page
lang is reset back to "en"
Expected behavior
The lang's value in localstorage should be respected so that users who have changed the language doesn't have to change the language every time the page is refreshed.
Screenshots
Possible Solution
Move the following code:
if (!this.manifest[this._lang]) { // The user's language isn't in the manifest... Just fall back to English
this._lang = "en";
}
//this.setLanguage(this._lang);
localStorage.setItem("lang", this._lang);
this.toggleLangTag();
Describe the bug Local storage key "lang" not being respected
To Reproduce Steps to reproduce the behavior:
Expected behavior The lang's value in localstorage should be respected so that users who have changed the language doesn't have to change the language every time the page is refreshed.
Screenshots
Possible Solution Move the following code:
into the fetch block
This should ensure that the manifest exists and so does the languages.
Maybe actually call the
getLanguage
function..