From d46fec9f483db0e8cf6cf5672289b6222043ee83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 2 Oct 2015 12:04:16 +0200 Subject: Define default translations for the "more" button in multi-part hints. --- js/codeq/hint.js | 4 +++- js/codeq/translation.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'js/codeq') diff --git a/js/codeq/hint.js b/js/codeq/hint.js index fb07cfb..331c822 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -22,6 +22,8 @@ planDef = problemDef.plan, templatePath = [problemDef.language, problemDef.group, problemDef.problem], templateName = templatePath.join('/'), + guiDict = codeq.tr.getDictionary('gui'), + btnMoreTranslations = guiDict['btn_more'] || {}, // get the default translations for the "more..." button clearHints = function () { var i; @@ -192,7 +194,7 @@ msg = content[lang][hintIndex]; if (typeof msg === 'string') { trContent[lang] = processTemplate(msg, args); - trButton[lang] = 'More...'; + trButton[lang] = btnMoreTranslations[lang] || 'More...'; } else { trContent[lang] = processTemplate(msg.message, args); diff --git a/js/codeq/translation.js b/js/codeq/translation.js index 67f49eb..dda5aec 100644 --- a/js/codeq/translation.js +++ b/js/codeq/translation.js @@ -76,6 +76,10 @@ jqTopElt.find('[data-tkey]').each(function () { translateElement($(this), lang); }); + }, + + 'getDictionary': function (name) { + return dicts[name]; } }; })(); \ No newline at end of file -- cgit v1.2.1