summaryrefslogtreecommitdiff
path: root/js/codeq/template.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/codeq/template.js')
-rw-r--r--js/codeq/template.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/codeq/template.js b/js/codeq/template.js
index 361811b..90b4db3 100644
--- a/js/codeq/template.js
+++ b/js/codeq/template.js
@@ -276,9 +276,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
resources = newResources;
},
+ // instantiate a template
'process': function (template, templatePath, args) {
var fn = templator(template, templatePath);
return fn(args);
+ },
+
+ // instantiate templates in a lang→template dictionary
+ 'processDictionary': function (dict, templatePath, args) {
+ var lang;
+ for (lang in dict) {
+ if (!dict.hasOwnProperty(lang)) continue;
+ dict[lang] = codeq.template.process(dict[lang], templatePath, args);
+ }
}
};
})();