From 56d838a0a69d30090b4ef3656498970e2a7486bc Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Fri, 6 Mar 2009 16:14:02 +0100 Subject: [PATCH] [IMP] * Remove incoherence in export language (remove required field to export pot file) * Add missing tools.translate import syntax * replace tabs per spaces * if only one module export and no language select, the name fo the file is the name of the module bzr revid: christophe.chauvet@syleam.fr-20090306151402-4gj8g9cba8sw3xms --- bin/addons/base/module/module_wizard.xml | 12 ++++++------ bin/addons/base/module/wizard/wizard_export_lang.py | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/addons/base/module/module_wizard.xml b/bin/addons/base/module/module_wizard.xml index a7e3ceba627..0d21f1eecbe 100644 --- a/bin/addons/base/module/module_wizard.xml +++ b/bin/addons/base/module/module_wizard.xml @@ -6,23 +6,23 @@ base.module.import - + Update Modules List module.module.update - + - + Load an Official Translation module.lang.install - + Export a Translation File wizard.module.lang.export form @@ -32,7 +32,7 @@ - + @@ -105,6 +105,6 @@ new - + diff --git a/bin/addons/base/module/wizard/wizard_export_lang.py b/bin/addons/base/module/wizard/wizard_export_lang.py index 2a56cac2fcc..58de337f45e 100644 --- a/bin/addons/base/module/wizard/wizard_export_lang.py +++ b/bin/addons/base/module/wizard/wizard_export_lang.py @@ -27,7 +27,7 @@ import cStringIO import csv import pooler from osv import fields,osv - +from tools.translate import _ class wizard_export_lang(osv.osv_memory): @@ -60,8 +60,10 @@ class wizard_export_lang(osv.osv_memory): elif this.format == 'tgz': ext = this.lang and '.po' or '.pot' this.advice = _('Save this document to a .tgz file. This archive containt UTF-8 %s files and may be uploaded to launchpad.') % (ext,) - - this.name = "%s.%s" % (this.lang or _('new'), this.format) + filename = _('new') + if not this.lang and len(mods) == 1: + filename = mods[0] + this.name = "%s.%s" % (this.lang or filename, this.format) out=base64.encodestring(buf.getvalue()) buf.close() return self.write(cr, uid, ids, {'state':'get', 'data':out, 'advice':this.advice, 'name':this.name}, context=context)