mapcomplete/UI/i18n/Locale.ts

24 lines
641 B
TypeScript
Raw Normal View History

2020-07-21 00:07:04 +02:00
import {UIEventSource} from "../UIEventSource";
import {LocalStorageSource} from "../../Logic/LocalStorageSource";
2020-07-25 18:00:08 +02:00
import {DropDown} from "../Input/DropDown";
import {Layout} from "../../Customizations/Layout";
import {UIElement} from "../UIElement";
import {State} from "../../State";
2020-07-20 12:39:43 +02:00
export default class Locale {
2020-07-25 18:00:08 +02:00
2020-07-31 04:58:58 +02:00
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;
2020-07-25 18:00:08 +02:00
}
2020-07-31 04:58:58 +02:00
2020-07-20 12:39:43 +02:00
}
2020-07-25 18:00:08 +02:00