diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-02 15:36:25 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-02 15:36:25 +0100 |
| commit | 0af13af5de42d64ef9e5a944890e6d6368391b7f (patch) | |
| tree | 594dfaf96f81d1c1207f55a88bb9e70688102101 /addons/web/static/src/js/core/qweb.js | |
| parent | cd5dcb8f9816bdefda7db2796a7255ba57f6c298 (diff) | |
| parent | ddd293065eccd005327139c9963cf1cdf5ab3cde (diff) | |
[MERGE] forward port branch saas-15 up to ddd293065ec
Diffstat (limited to 'addons/web/static/src/js/core/qweb.js')
| -rw-r--r-- | addons/web/static/src/js/core/qweb.js | 15 |
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; } |
