forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
94f66eafc1
56 changed files with 2336 additions and 832 deletions
|
@ -7,7 +7,7 @@ export class Translation extends BaseUIElement {
|
|||
public static forcedLanguage = undefined;
|
||||
|
||||
public readonly translations: object
|
||||
|
||||
|
||||
constructor(translations: object, context?: string) {
|
||||
super()
|
||||
if (translations === undefined) {
|
||||
|
@ -36,6 +36,11 @@ export class Translation extends BaseUIElement {
|
|||
get txt(): string {
|
||||
return this.textFor(Translation.forcedLanguage ?? Locale.language.data)
|
||||
}
|
||||
|
||||
Destroy() {
|
||||
super.Destroy();
|
||||
this.isDestroyed = true;
|
||||
}
|
||||
|
||||
static ExtractAllTranslationsFrom(object: any, context = ""): { context: string, tr: Translation }[] {
|
||||
const allTranslations: { context: string, tr: Translation }[] = []
|
||||
|
@ -93,7 +98,11 @@ export class Translation extends BaseUIElement {
|
|||
|
||||
InnerConstructElement(): HTMLElement {
|
||||
const el = document.createElement("span")
|
||||
const self = this
|
||||
Locale.language.addCallbackAndRun(_ => {
|
||||
if(self.isDestroyed){
|
||||
return true
|
||||
}
|
||||
el.innerHTML = this.txt
|
||||
})
|
||||
return el;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue