[MERGE] Branch from Christophe Chauvet (Sylëam)

[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: stephane@tinyerp.com-20090319152644-g1nr2qkr2aut9c02
This commit is contained in:
Stephane Wirtel 2009-03-19 16:26:44 +01:00
commit c1fbc04b86
2 changed files with 11 additions and 9 deletions

View File

@ -6,23 +6,23 @@
<field name="wiz_name">base.module.import</field>
</record>
<menuitem action="wizard_base_module_import" id="menu_wizard_module_import" parent="menu_management" type="wizard"/>
<record id="wizard_update" model="ir.actions.wizard">
<field name="name">Update Modules List</field>
<field name="wiz_name">module.module.update</field>
</record>
<menuitem action="wizard_update" icon="STOCK_CONVERT" id="menu_module_update" parent="menu_management" type="wizard"/>
<wizard id="wizard_upgrade" model="ir.module.module" name="module.upgrade" string="Apply Scheduled Upgrades"/>
<menuitem action="wizard_upgrade" id="menu_wizard_upgrade" parent="menu_management" type="wizard"/>
<record id="wizard_lang_install" model="ir.actions.wizard">
<field name="name">Load an Official Translation</field>
<field name="wiz_name">module.lang.install</field>
</record>
<menuitem action="wizard_lang_install" id="menu_wizard_lang_install" parent="menu_translation" type="wizard"/>
<record id="wizard_lang_export" model="ir.ui.view">
<record id="wizard_lang_export" model="ir.ui.view">
<field name="name">Export a Translation File</field>
<field name="model">wizard.module.lang.export</field>
<field name="type">form</field>
@ -32,7 +32,7 @@
<page string="Export Data">
<group col="2" fill="0" states="choose">
<separator colspan="2" string="Export translation file"/>
<field name="lang" required="1" width="300"/>
<field name="lang" width="300"/>
<field name="format" required="1"/>
<field height="200" name="modules" width="500"/>
<field invisible="1" name="state"/>
@ -105,6 +105,6 @@
<field name="target">new</field>
</record>
<menuitem action="action_wizard_update_translations" id="menu_wizard_update_translations" parent="menu_translation_app"/>
</data>
</openerp>

View File

@ -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)