[MERGE] merged nch fix for the help tool tip missing translation.

bzr revid: vmt@openerp.com-20110426091350-7cs7sh5imzf73rcs
This commit is contained in:
Vo Minh Thu 2011-04-26 11:13:50 +02:00
commit 06202d2541
2 changed files with 7 additions and 1 deletions

View File

@ -1277,6 +1277,10 @@ class orm_template(object):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum'))
if trans:
node.set('sum', trans)
if node.get('help'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('help'))
if trans:
node.set('help', trans)
for f in node:
if children or (node.tag == 'field' and f.tag in ('filter','separator')):

View File

@ -503,6 +503,8 @@ def trans_parse_view(de):
res.append(de.text.encode("utf8"))
if de.get("string"):
res.append(de.get('string').encode("utf8"))
if de.get("help"):
res.append(de.get('help').encode("utf8"))
if de.get("sum"):
res.append(de.get('sum').encode("utf8"))
if de.get("confirm"):
@ -993,7 +995,7 @@ def resetlocale():
def load_language(cr, lang):
"""Loads a translation terms for a language.
Used mainly to automate language loading at db initialization.
:param lang: language ISO code with optional _underscore_ and l10n flavor (ex: 'fr', 'fr_BE', but not 'fr-BE')
:type lang: str
"""