Skip to content

Commit

Permalink
[FIX] translate: possibility to disable translation of view nodes
Browse files Browse the repository at this point in the history
Node content of inherited views using <attribute> tags are added
in the translation terms when syncing the terms.

The fact that the content should be translated or not depends
on the content, or to which attribute it refers.
For instance, string attributes should be translated, but
domains probably not.
But, even for domains, this is possible that it requires a translation
e.g. [('category_id.name', 'ilike', 'Customers')].
This domain is very unlikely to be integrated in the standard source code,
but this is possible to have such a domain in a view customization.

Therefore, we provide the possibility to disable the translation
case by case. Setting translation="off" in the attribute of the node
will prevent to add the node content in the translated terms.

opw-625762
  • Loading branch information
beledouxdenis committed Feb 20, 2015
1 parent d5c4a1c commit 2e7347d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openerp/tools/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def trans_parse_view(element, callback):
for el in element.iter():
if (not isinstance(el, SKIPPED_ELEMENT_TYPES)
and el.tag.lower() not in SKIPPED_ELEMENTS
and el.get("translation", '').strip() != "off"
and el.text):
_push(callback, el.text, el.sourceline)
if el.tail:
Expand Down

0 comments on commit 2e7347d

Please sign in to comment.