diff options
author | Aleš Smodiš <aless@guru.si> | 2015-10-02 12:04:16 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-10-02 12:04:16 +0200 |
commit | d46fec9f483db0e8cf6cf5672289b6222043ee83 (patch) | |
tree | b4d1d5cb82686ef66cd883d8a0e0b12437ca251b | |
parent | 0c168d0027f3350344d0fcdf16c554dcc8f3c92b (diff) |
Define default translations for the "more" button in multi-part hints.
-rw-r--r-- | js/codeq/hint.js | 4 | ||||
-rw-r--r-- | js/codeq/translation.js | 4 | ||||
-rw-r--r-- | res/en.json | 3 | ||||
-rw-r--r-- | res/sl.json | 3 |
4 files changed, 11 insertions, 3 deletions
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 diff --git a/res/en.json b/res/en.json index 5330cdc..3fb2d7a 100644 --- a/res/en.json +++ b/res/en.json @@ -11,5 +11,6 @@ "btn_hint": "Hint", "btn_test": "Test", "btn_run": "Run", - "btn_stop": "Stop" + "btn_stop": "Stop", + "btn_more": "More..." }
\ No newline at end of file diff --git a/res/sl.json b/res/sl.json index cdde4f4..7f5cf7f 100644 --- a/res/sl.json +++ b/res/sl.json @@ -11,5 +11,6 @@ "btn_hint": "Namig", "btn_test": "Testiraj", "btn_run": "Zaženi", - "btn_stop": "Ustavi" + "btn_stop": "Ustavi", + "btn_more": "Več..." }
\ No newline at end of file |