1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Fix getLangText() when using multiple placeholders

This commit is contained in:
Brett Sun 2015-11-02 15:21:27 +01:00
parent fe06ea607f
commit 7746241a59

View File

@ -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);
//}