Merge develop

This commit is contained in:
Pieter Vander Vennet 2022-01-06 20:10:57 +01:00
commit 94f66eafc1
56 changed files with 2336 additions and 832 deletions

View file

@ -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;