call function scan language for selection field

bzr revid: nel@silver-20081216125934-nmsxq3cmawhgtl3k
This commit is contained in:
Najlaa
2008-12-16 13:59:34 +01:00
parent a6b3be7f10
commit 48bf6ab1e8
2 changed files with 2 additions and 8 deletions
@@ -26,7 +26,6 @@ import base64
import StringIO
import csv
import pooler
from osv import fields,osv
@@ -51,7 +50,6 @@ class wizard_export_lang(osv.osv_memory):
mods = map(lambda m: m.name, this.modules) or ['all']
mods.sort()
buf=StringIO.StringIO()
tools.trans_export(this.lang, mods, buf, this.format, dbname=cr.dbname)
if this.format == 'csv':
this.advice = _("Save this document to a .CSV file and open it with your favourite spreadsheet software. The file encoding is UTF-8. You have to translate the latest column before reimporting it.")
@@ -64,8 +62,7 @@ class wizard_export_lang(osv.osv_memory):
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)
out=base64.encodestring(buf.getvalue())
out=base64.encodestring(buf.getvalue().encode('utf8'))
buf.close()
return self.write(cr, uid, ids, {'state':'get', 'data':out, 'advice':this.advice, 'name':this.name}, context=context)
@@ -54,11 +54,8 @@ class wizard_lang_install(wizard.interface):
modobj.update_translations(cr, uid, mids, lang)
return {}
def _get_language(sel, cr, uid, context):
return tools.scan_languages()
fields_form = {
'lang': {'string':'Language', 'type':'selection', 'selection':_get_language,
'lang': {'string':'Language', 'type':'selection', 'selection':tools.scan_languages(),
},
}