forked from MapComplete/MapComplete
Playing with new translations, merging branches
This commit is contained in:
commit
6f8c29d401
32 changed files with 609 additions and 163 deletions
|
@ -3,7 +3,7 @@ import {OsmConnection} from "../../Logic/OsmConnection";
|
|||
|
||||
|
||||
export default class Locale {
|
||||
public static language: UIEventSource<string> = Locale.getInitialLanguage()
|
||||
public static language: UIEventSource<string> = Locale.getInitialLanguage();
|
||||
|
||||
private static getInitialLanguage() {
|
||||
// The key to save in local storage
|
||||
|
@ -12,13 +12,13 @@ export default class Locale {
|
|||
const lng = new UIEventSource("en");
|
||||
const saved = localStorage.getItem(LANGUAGE_KEY);
|
||||
lng.setData(saved);
|
||||
|
||||
|
||||
|
||||
lng.addCallback(data => {
|
||||
console.log("Selected language", data);
|
||||
localStorage.setItem(LANGUAGE_KEY, data)
|
||||
});
|
||||
|
||||
|
||||
return lng;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue