[FIX] website: don't unescape translation text node content

When we had things like   or & in a text we want to translate,
the translation system would save it unescape (so \xa0 and &).

So in this instance, the traduction would not match the real source
which was not subjected to this unescaping.

opw-653173

note: fix is courtesy of dle (no need to forward port after saas-6)
This commit is contained in:
Nicolas Lempereur 2015-10-30 16:06:00 +01:00
parent ee2b550f3c
commit 70d0026125
1 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@
// TODO: link nodes with same content
node.className += ' oe_translatable_text';
node.setAttribute('data-oe-translation-view-id', view_id);
var content = node.childNodes[0].data.trim();
var content = $(node).html().trim();
var trans = this.translations.filter(function (t) {
return t.res_id === view_id && t.value.trim() === content;
});
@ -160,7 +160,7 @@
}
trans[data.oeTranslationViewId].push({
initial_content: self.getInitialContent(this),
new_content: $node.text(),
new_content: $node.html(),
translation_id: data.oeTranslationId || null
});
});