diff options
| author | Christophe Simonis <christophe@cobalt> | 2008-12-16 17:21:12 +0100 |
|---|---|---|
| committer | Christophe Simonis <christophe@cobalt> | 2008-12-16 17:21:12 +0100 |
| commit | 4d3b92861091a8eba72453bcf7a891eeadbfbdbe (patch) | |
| tree | 7045312a43a6a160c4704157026da26d6dca1145 /bin/wizard/__init__.py | |
| parent | 48bf6ab1e826123e667ffcd93fc6d50ccc8630cb (diff) | |
[FIX] translate help of fields in wizards
[FIX] fix unicode errors when exporting translations files
lp bug: https://launchpad.net/bugs/308563 fixed
lp bug: https://launchpad.net/bugs/308644 fixed
bzr revid: christophe@cobalt-20081216162112-75r2kaflg3af0xxb
Diffstat (limited to 'bin/wizard/__init__.py')
| -rw-r--r-- | bin/wizard/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/wizard/__init__.py b/bin/wizard/__init__.py index fcacf67a476..8996ce0cb80 100644 --- a/bin/wizard/__init__.py +++ b/bin/wizard/__init__.py @@ -113,15 +113,22 @@ class interface(netsvc.Service): if lang: # translate fields for field in fields: - trans = translate(cr, self.wiz_name+','+state+','+field, 'wizard_field', lang) + res_name = "%s,%s,%s" % (self.wiz_name, state, field) + + trans = translate(cr, res_name, 'wizard_field', lang) if trans: fields[field]['string'] = trans if 'selection' in fields[field]: - trans = lambda x: translate(cr, self.wiz_name+','+state+','+field, 'selection', lang, x) or x + trans = lambda x: translate(cr, res_name, 'selection', lang, x) or x for idx, (key, val) in enumerate(fields[field]['selection']): fields[field]['selection'][idx] = (key, trans(val)) + if 'help' in fields[field]: + t = translate(cr, res_name, 'help', lang, fields[field]['help']) + if t: + fields[field]['help'] = t + # translate arch if not isinstance(arch, UpdateableStr): doc = dom.minidom.parseString(arch) |
