summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/qweb.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-01-03 12:28:52 +0100
committerChristophe Simonis <chs@odoo.com>2018-01-03 12:28:52 +0100
commit362f0489d07d5bcd3673278e93848d0ea3d177a8 (patch)
treece164613ca633d736bf41c5b3d02b8ee541baa89 /addons/web/static/src/js/core/qweb.js
parenta39491d459f7a70af21bce1f45434bab05f1c284 (diff)
parentfe22a0f9ca92ef0e76bb2f730a2b22da500db5dd (diff)
[MERGE] forward port branch 11.0 up to fe22a0f9ca9
Diffstat (limited to 'addons/web/static/src/js/core/qweb.js')
-rw-r--r--addons/web/static/src/js/core/qweb.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/qweb.js b/addons/web/static/src/js/core/qweb.js
index 50742075e05..253e948d8ac 100644
--- a/addons/web/static/src/js/core/qweb.js
+++ b/addons/web/static/src/js/core/qweb.js
@@ -5,7 +5,18 @@ var translation = require('web.translation');
var _t = translation._t;
-function QWeb(debug, default_dict) {
+/**
+ * @param {boolean} debug
+ * @param {Object} default_dict
+ * @param {boolean} [enableTranslation=true] if true (this is the default),
+ * the rendering will translate all strings that are not marked with
+ * t-translation=off. This is useful for the kanban view, which uses a
+ * template which is already translated by the server
+ */
+function QWeb(debug, default_dict, enableTranslation) {
+ if (enableTranslation === undefined) {
+ enableTranslation = true;
+ }
var qweb = new QWeb2.Engine();
qweb.default_dict = _.extend({}, default_dict || {}, {
'_' : _,
@@ -16,7 +27,7 @@ function QWeb(debug, default_dict) {
'csrf_token': odoo.csrf_token,
});
qweb.debug = debug;
- qweb.preprocess_node = preprocess_node;
+ qweb.preprocess_node = enableTranslation ? preprocess_node : function () {};
return qweb;
}