Add fallback language
This commit is contained in:
parent
0f2dff8f41
commit
d5f7f917ae
1 changed files with 7 additions and 1 deletions
|
@ -11,8 +11,14 @@ 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);
|
||||||
|
if (en !== undefined) {
|
||||||
return en;
|
return en;
|
||||||
}
|
}
|
||||||
|
for (const i in this.translations) {
|
||||||
|
return this.translations[i]; // Return a random language
|
||||||
|
}
|
||||||
|
return "Missing translation"
|
||||||
|
}
|
||||||
|
|
||||||
InnerRender(): string {
|
InnerRender(): string {
|
||||||
return this.txt
|
return this.txt
|
||||||
|
|
Loading…
Reference in a new issue