Add first version of the food theme

This commit is contained in:
Pieter Vander Vennet 2021-09-02 21:22:34 +02:00
parent 23af637a81
commit 92e8f3f89d
20 changed files with 629 additions and 30 deletions

View file

@ -111,9 +111,10 @@ export class Translation extends BaseUIElement {
rtext = date.toLocaleString();
} else if (el.ConstructElement === undefined) {
console.error("ConstructElement is not defined", el);
throw "ConstructElement is not defined, you are working with a "+(typeof el)+":"+(el.constructor.name)
throw "ConstructElement is not defined, you are working with a " + (typeof el) + ":" + (el.constructor.name)
}else if(el["translations"] !== undefined){
rtext = el["translations"][lang]
} else {
Translation.forcedLanguage = lang; // This is a very dirty hack - it'll bite me one day
rtext = el.ConstructElement().innerHTML;
}
@ -126,7 +127,6 @@ export class Translation extends BaseUIElement {
}
newTranslations[lang] = template;
}
Translation.forcedLanguage = undefined;
return new Translation(newTranslations);
}