From a3a2ec416b3fb4be2dbf6ed0333b3d1417ddc206 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 18 Sep 2012 09:28:02 +0200 Subject: [IMP] translation: load translations from ir.translation after authenticating, use local POs for bootstrap only (login page) bzr revid: odo@openerp.com-20120918072802-568n19bg1ecm1m2t --- addons/web/static/src/js/coresetup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/coresetup.js') diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index ea160d6faee..826275bfa0f 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); + }) + ); }); }, /** -- cgit v1.2.3 From f742d3b213e36df0e6b826fb3d0de610251db4fc Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 28 Sep 2012 23:00:07 +0200 Subject: [FIX] web: minor improvements to some translateable terms bzr revid: odo@openerp.com-20120928210007-ukf4u20rpwmugfwt --- addons/web/static/src/js/coresetup.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/web/static/src/js/coresetup.js') diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 826275bfa0f..4a30a312b7a 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -605,8 +605,7 @@ var messages_by_seconds = function() { [120, _t("Don't leave yet,
it's still loading...")], [300, _t("You may not believe it,
but the application is actually loading...")], [420, _t("Take a minute to get a coffee,
because it's loading...")], - [600, _t("It's loading...
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...")], ]; }; -- cgit v1.2.3 From 2514a564513918231a43785bfc48df753d16d700 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 3 Oct 2012 18:35:04 +0200 Subject: [FIX] coresetup: avoid losing whitespace after qweb translations bzr revid: odo@openerp.com-20121003163504-64piei7sjv0b41wx --- addons/web/static/src/js/coresetup.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'addons/web/static/src/js/coresetup.js') diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 4a30a312b7a..d55408ebc83 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -542,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: -- cgit v1.2.3