From 44e8b92beb4d066c6192fd723cff8299f19d9628 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu <chm@odoo.com> Date: Wed, 25 May 2016 15:10:45 +0200 Subject: [PATCH] [FIX] translate: don't translate DOCTYPE tag --- openerp/tools/translate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 756edfb61ced..a852f05de77d 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -32,7 +32,7 @@ _logger = logging.getLogger(__name__) # used to notify web client that these translations should be loaded in the UI WEB_TRANSLATION_COMMENT = "openerp-web" -SKIPPED_ELEMENTS = ('script', 'style') +SKIPPED_ELEMENTS = ('script', 'style', 'title') _LOCALE2WIN32 = { 'af_ZA': 'Afrikaans_South Africa', @@ -231,7 +231,8 @@ class XMLTranslator(object): isinstance(node, SKIPPED_ELEMENT_TYPES) or node.tag in SKIPPED_ELEMENTS or node.get("t-translation", "").strip() == "off" or - node.tag == "attribute" and node.get("name") not in TRANSLATED_ATTRS + node.tag == "attribute" and node.get("name") not in TRANSLATED_ATTRS or + not node.getparent() and node.text and '<!DOCTYPE' in node.text ): # do not translate the contents of the node tail, node.tail = node.tail, None -- GitLab