[FIX] coresetup: avoid losing whitespace after qweb translations

bzr revid: odo@openerp.com-20121003163504-64piei7sjv0b41wx
This commit is contained in:
Olivier Dony 2012-10-03 18:35:04 +02:00
parent a09b2fdff1
commit 2514a56451
1 changed files with 3 additions and 7 deletions

View File

@ -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: