Hi,
it is possible to implement some fallbacks if a key could not be resolved?
The following logic would be conceivable:
If the key in the actual language not available, makes a fallback to defaultLanguage.
If even defaultLanguage[key] doesn't resolve, it returns the key.
Put this code to Translator instant function before line 263:
var t;
if (!this.translations[language] || !this.translations[language][key]) {
this.logHandler.info(this.generateMessage("missing", { key: key, language: language }));
if (language === this.config.defaultLanguage) {
// This key is not available in the default language
return key;
}
else {
// Use default language to translate the key
t = this.instant(key, params, this.config.defaultLanguage);
}
}
else {
t = this.translations[language][key];
}
Hi, it is possible to implement some fallbacks if a key could not be resolved? The following logic would be conceivable:
Put this code to Translator instant function before line 263: