1
0
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:
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(); let lang = getLang();
try { try {
if(lang in languages) { if(lang in languages) {
return formatText(languages[lang][s], args); return formatText(languages[lang][s], ...args);
} else { } else {
// just use the english language // just use the english language
return formatText(languages['en-US'][s], args); return formatText(languages['en-US'][s], ...args);
} }
} catch(err) { } catch(err) {
//if(!(s in languages[lang])) { //if(!(s in languages[lang])) {
//console.warn('Language-string is not in constants file. Add: "' + s + '" to the "' + lang + '" language file. Defaulting to keyname'); //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 { //} else {
// console.error(err); // console.error(err);
//} //}