forked from MapComplete/MapComplete
Add custom theme for advanced users
This commit is contained in:
parent
004eead4ee
commit
9c42839f01
44 changed files with 635 additions and 326 deletions
|
@ -7,15 +7,17 @@ import {State} from "../../State";
|
|||
|
||||
|
||||
export default class Locale {
|
||||
public static language: UIEventSource<string> = LocalStorageSource.Get('language', "en");
|
||||
|
||||
public static CreateLanguagePicker(label: string | UIElement = "") {
|
||||
|
||||
return new DropDown(label, State.state.layoutToUse.data.supportedLanguages.map(lang => {
|
||||
return {value: lang, shown: lang}
|
||||
}
|
||||
), Locale.language);
|
||||
public static language: UIEventSource<string> = Locale.setup();
|
||||
private static setup() {
|
||||
const source = LocalStorageSource.Get('language', "en");
|
||||
// @ts-ignore
|
||||
window.setLanguage = function (language: string) {
|
||||
source.setData(language)
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue