Enabling use of dict-translation %(key)s

This commit is contained in:
Dennis Ploeger 2013-09-22 08:28:39 +02:00
parent f294caf3e3
commit bc2c85b400

View file

@ -8,7 +8,8 @@ wn._ = function(txt, replace) {
if(typeof(txt) != "string") return txt;
preformat = wn._messages[txt.replace(/\n/g, "")] || txt;
if(!replace) return preformat;
return vsprintf(preformat, replace);
if(replace instanceof Array) return vsprintf(preformat, replace);
return repl(preformat, replace);
};
wn.translate = function(obj, keys) {
$.each(keys, function(i, key) {