Skip to content
Snippets Groups Projects
Commit 70d871d8 authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

[FIX] translate: don't translate DOCTYPE tag

parent 25bf3e9f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment