From 70d00261253ef7e4a39fe363a4ac190f16ea7da6 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 30 Oct 2015 16:06:00 +0100 Subject: [PATCH] [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) --- addons/website/static/src/js/website.translator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/website.translator.js b/addons/website/static/src/js/website.translator.js index bea3406a40f..ac04ddaf4c1 100644 --- a/addons/website/static/src/js/website.translator.js +++ b/addons/website/static/src/js/website.translator.js @@ -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 }); });