forked from MapComplete/MapComplete
chore: update documentation, fix a few issues to make a new development setup easier, fix #1343
This commit is contained in:
parent
c11bcb1817
commit
2f56f4d9fd
8 changed files with 25 additions and 24 deletions
|
@ -4,9 +4,9 @@ import BaseUIElement from "./BaseUIElement"
|
|||
import native from "../assets/language_native.json"
|
||||
import language_translations from "../assets/language_translations.json"
|
||||
import { Translation } from "./i18n/Translation"
|
||||
import used_languages from "../assets/generated/used_languages.json"
|
||||
import Lazy from "./Base/Lazy"
|
||||
import Toggle from "./Input/Toggle"
|
||||
import LanguageUtils from "../Utils/LanguageUtils"
|
||||
|
||||
export default class LanguagePicker extends Toggle {
|
||||
constructor(languages: string[], label: string | BaseUIElement = "") {
|
||||
|
@ -17,7 +17,7 @@ export default class LanguagePicker extends Toggle {
|
|||
const normalPicker = LanguagePicker.dropdownFor(languages, label)
|
||||
const fullPicker = new Lazy(() => LanguagePicker.dropdownFor(allLanguages, label))
|
||||
super(fullPicker, normalPicker, Locale.showLinkToWeblate)
|
||||
const allLanguages: string[] = used_languages.languages
|
||||
const allLanguages: string[] = LanguageUtils.usedLanguagesSorted
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { FixedUiElement } from "../Base/FixedUiElement"
|
||||
import { Translation, TypedTranslation } from "./Translation"
|
||||
import BaseUIElement from "../BaseUIElement"
|
||||
import known_languages from "../../assets/generated/used_languages.json"
|
||||
import CompiledTranslations from "../../assets/generated/CompiledTranslations"
|
||||
import LanguageUtils from "../../Utils/LanguageUtils"
|
||||
|
||||
export default class Translations {
|
||||
static readonly t: typeof CompiledTranslations.t & Readonly<typeof CompiledTranslations.t> =
|
||||
CompiledTranslations.t
|
||||
private static knownLanguages = new Set(known_languages.languages)
|
||||
private static knownLanguages = LanguageUtils.usedLanguages
|
||||
constructor() {
|
||||
throw "Translations is static. If you want to intitialize a new translation, use the singular form"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue