diff options
| author | Frédéric van der Essen <fva@openerp.com> | 2012-10-04 11:44:29 +0200 |
|---|---|---|
| committer | Frédéric van der Essen <fva@openerp.com> | 2012-10-04 11:44:29 +0200 |
| commit | 28a8768a63a8a8d5ac0c8f4a905a9ef4df3975c4 (patch) | |
| tree | 25d6eccb7e5dac6c961e3866ef2c47e76e7e98ef /addons/web/static/src/js | |
| parent | 192acbb383868c2883866ace3ebd6e984b1d22c7 (diff) | |
| parent | 29a53e19546570b97932d163a0c2d0a2acf4a7ff (diff) | |
[MERGE] from trunk
bzr revid: fva@openerp.com-20121004094429-hq4lcntvkycytnj6
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/coresetup.js | 20 | ||||
| -rw-r--r-- | addons/web/static/src/js/search.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index ea160d6faee..d55408ebc83 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -57,7 +57,12 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess if(self.session_is_valid()) { return deferred.pipe(function() { return self.load_modules(); }); } - return deferred; + return $.when( + deferred, + self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).pipe(function(trans) { + instance.web._t.database.set_bundle(trans); + }) + ); }); }, /** @@ -537,13 +542,9 @@ instance.web.qweb.preprocess_node = function() { if (translation && translation.value === 'off') { return; } - var ts = _.str.trim(this.node.data); - if (ts.length === 0) { - return; - } - var tr = instance.web._t(ts); - if (tr !== ts) { - this.node.data = tr; + var match = /^(\s*)(.+?)(\s*)$/.exec(this.node.data); + if (match) { + this.node.data = match[1] + instance.web._t(match[2]) + match[3]; } break; case 1: @@ -600,8 +601,7 @@ var messages_by_seconds = function() { [120, _t("Don't leave yet,<br />it's still loading...")], [300, _t("You may not believe it,<br />but the application is actually loading...")], [420, _t("Take a minute to get a coffee,<br />because it's loading...")], - [600, _t("It's loading...<br />By the way, did you tried the kitten mode?")], - [3600, _t("Maybe you should consider pressing F5...")], + [3600, _t("Maybe you should consider reloading the application by pressing F5...")], ]; }; diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 01bc0c76c87..71e955e80a6 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1494,7 +1494,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ return $.when(facet_from(this, value)); } assert(value.length <= 1, - _("M2O search fields do not currently handle multiple default values")); + _t("M2O search fields do not currently handle multiple default values")); // there are many cases of {search_default_$m2ofield: [id]}, need // to handle this as if it were a single value. value = value[0]; @@ -1578,7 +1578,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ $filter.unbind('click').click(function () { self.view.query.reset([{ - category: _("Custom Filter"), + category: _t("Custom Filter"), icon: 'M', field: { get_context: function () { return filter.context; }, diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bf6b869482b..1c32d5ef63e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2081,7 +2081,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w var self = this; var trans = new instance.web.DataSet(this, 'ir.translation'); return trans.call_button('translate_fields', [this.view.dataset.model, this.view.datarecord.id, this.name, this.view.dataset.get_context()]).then(function(r) { - self.do_action(r.result); + self.do_action(r); }); }, }); @@ -4282,7 +4282,7 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ this.dataset.create_function = function(data, sup) { var fct = self.options.create_function || sup; return fct.call(this, data).then(function(r) { - self.created_elements.push(r.result); + self.created_elements.push(r); }); }; this.dataset.write_function = function(id, data, options, sup) { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 2fff0e7b683..7b5fcc70289 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1190,7 +1190,7 @@ instance.web.View = instance.web.Widget.extend({ var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {}); var handler = function (r) { - var action = r.result; + var action = r; if (action && action.constructor == Object) { var ncontext = new instance.web.CompoundContext(context); if (record_id) { |
