From 7c8c735e05f11a169c92fe8d6beb11d8697f18c4 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 6 Jan 2014 02:49:41 -0500 Subject: [PATCH] i8n - if translation not present, use a readable key --- public/src/translator.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/public/src/translator.js b/public/src/translator.js index 7f87402557..fb8f602006 100644 --- a/public/src/translator.js +++ b/public/src/translator.js @@ -62,11 +62,6 @@ async.map(keys, getKey, callback); } - - /* - * TODO: Not fully converted to server side yet, ideally server should be able to parse whole templates on demand if necessary - * fix: translator.load should determine if server side and immediately return appropriate language file. - */ translator.translate = function (data, callback) { var keys = data.match(/\[\[.*?\]\]/g), loading = 0; @@ -79,9 +74,11 @@ } text = text.replace(key, value); + } else { + var string = key.split(':'); + text = text.replace(key, string[string.length-1].replace(/\]+$/, '')); } - return text; }