forked from MapComplete/MapComplete
Fixed custom generator by fixing dependencies
This commit is contained in:
parent
d326e56b15
commit
9c53fe9868
5 changed files with 88 additions and 78 deletions
23
UI/LanguagePicker.ts
Normal file
23
UI/LanguagePicker.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import {UIElement} from "./UIElement";
|
||||
import {DropDown} from "./Input/DropDown";
|
||||
import Locale from "./i18n/Locale";
|
||||
|
||||
export default class LanguagePicker {
|
||||
|
||||
|
||||
public static CreateLanguagePicker(
|
||||
languages : string[] ,
|
||||
label: string | UIElement = "") {
|
||||
|
||||
if (languages.length <= 1) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return new DropDown(label, languages.map(lang => {
|
||||
return {value: lang, shown: lang}
|
||||
}
|
||||
), Locale.language);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue