Add fallback language

This commit is contained in:
Pieter Vander Vennet 2020-07-21 15:18:11 +02:00
parent 0f2dff8f41
commit d5f7f917ae

View file

@ -11,7 +11,13 @@ export default class Translation extends UIElement {
} }
const en = this.translations["en"]; const en = this.translations["en"];
console.warn("No translation for language ", Locale.language.data, "for", en); console.warn("No translation for language ", Locale.language.data, "for", en);
return en; if (en !== undefined) {
return en;
}
for (const i in this.translations) {
return this.translations[i]; // Return a random language
}
return "Missing translation"
} }
InnerRender(): string { InnerRender(): string {