From bc2c85b4008ee1d35410587efbcfca848a3f2bbf Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Sun, 22 Sep 2013 08:28:39 +0200 Subject: [PATCH] Enabling use of dict-translation %(key)s --- public/js/wn/translate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/wn/translate.js b/public/js/wn/translate.js index 7c1cc07dca..0c97d391f8 100644 --- a/public/js/wn/translate.js +++ b/public/js/wn/translate.js @@ -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) {