[FIX] Website translation pairing bug
authorFabien Meghazi <fme@openerp.com>
Wed, 3 Sep 2014 10:09:31 +0000 (12:09 +0200)
committerFabien Meghazi <fme@openerp.com>
Wed, 3 Sep 2014 10:09:31 +0000 (12:09 +0200)
I think we could get rid of the .trim() calls (for performance sake)
but I don't want to break anything so I'll leave them.

addons/website/static/src/js/website.translator.js

index 674b2f7..a180079 100644 (file)
             node.setAttribute('data-oe-translation-view-id', view_id);
             var content = node.childNodes[0].data.trim();
             var trans = this.translations.filter(function (t) {
-                return t.res_id === view_id && t.value === content;
+                return t.res_id === view_id && t.value.trim() === content;
             });
             if (trans.length) {
                 node.setAttribute('data-oe-translation-id', trans[0].id);