mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Fix getLangText() when using multiple placeholders
This commit is contained in:
parent
fe06ea607f
commit
7746241a59
@ -22,15 +22,15 @@ export function getLangText(s, ...args) {
|
||||
let lang = getLang();
|
||||
try {
|
||||
if(lang in languages) {
|
||||
return formatText(languages[lang][s], args);
|
||||
return formatText(languages[lang][s], ...args);
|
||||
} else {
|
||||
// just use the english language
|
||||
return formatText(languages['en-US'][s], args);
|
||||
return formatText(languages['en-US'][s], ...args);
|
||||
}
|
||||
} catch(err) {
|
||||
//if(!(s in languages[lang])) {
|
||||
//console.warn('Language-string is not in constants file. Add: "' + s + '" to the "' + lang + '" language file. Defaulting to keyname');
|
||||
return formatText(s, args);
|
||||
return formatText(s, ...args);
|
||||
//} else {
|
||||
// console.error(err);
|
||||
//}
|
||||
|
Loading…
Reference in New Issue
Block a user