Add fallback language
This commit is contained in:
parent
0f2dff8f41
commit
d5f7f917ae
1 changed files with 7 additions and 1 deletions
|
@ -11,7 +11,13 @@ export default class Translation extends UIElement {
|
|||
}
|
||||
const en = this.translations["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 {
|
||||
|
|
Loading…
Reference in a new issue