summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/wizard/wizard_export_lang.py
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2008-07-18 15:13:50 +0200
committerChristophe Simonis <christophe@tinyerp.com>2008-07-18 15:13:50 +0200
commit2ccf0092a7e78b766a03475feedc12ca6c6dc21a (patch)
treeea18559505a0d0ad34ec9984a9e5aa3b967bdcb2 /bin/addons/base/module/wizard/wizard_export_lang.py
parent7cc947cb02c08c753fc3e1fcd52a608bc542090f (diff)
* the translations are graphically exportable by module
* allow importation of po files bzr revid: christophe@tinyerp.com-20080718131350-tftqhvwyyaz8r1q9
Diffstat (limited to 'bin/addons/base/module/wizard/wizard_export_lang.py')
-rw-r--r--bin/addons/base/module/wizard/wizard_export_lang.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/addons/base/module/wizard/wizard_export_lang.py b/bin/addons/base/module/wizard/wizard_export_lang.py
index 0bd589a3691..9571f7267cd 100644
--- a/bin/addons/base/module/wizard/wizard_export_lang.py
+++ b/bin/addons/base/module/wizard/wizard_export_lang.py
@@ -123,7 +123,9 @@ class wizard_export_lang(osv.osv_memory):
def act_getfile(self, cr, uid, ids, context=None):
this = self.browse(cr, uid, ids)[0]
- file=tools.trans_generate(this.lang, 'all', dbname=cr.dbname)
+ mods = map(lambda m: m.name, this.modules)
+ mods.sort()
+ file=tools.trans_generate(this.lang, mods, dbname=cr.dbname)
buf=StringIO.StringIO()
if this.format == 'csv':
@@ -135,8 +137,9 @@ class wizard_export_lang(osv.osv_memory):
this.advice = _("Save this document to a .po file and edit it with a specific software or a text editor. The file encoding is UTF-8.")
file.pop(0)
writer = tools.TinyPoFile(buf)
+ writer.write_infos(mods)
for module, type, name, res_id, src, trad in file:
- writer.write(type, name, res_id, src, trad)
+ writer.write(module, type, name, res_id, src, trad)
else:
raise osv_except(_('Bad file format'))
@@ -149,6 +152,7 @@ class wizard_export_lang(osv.osv_memory):
_columns = {
'lang': fields.selection(_get_languages, 'Language',required=True),
'format': fields.selection( ( ('csv','CSV File'), ('po','PO File') ), 'File Format', required=True),
+ 'modules': fields.many2many('ir.module.module', 'rel_modules_langexport', 'wiz_id', 'module_id', 'Modules', domain=[('state','=','installed')]),
'data': fields.binary('File', readonly=True),
'advice': fields.text('', readonly=True),
'state': fields.selection( ( ('choose','choose'), # choose language