call function scan language for selection field
bzr revid: nel@silver-20081216125934-nmsxq3cmawhgtl3k
This commit is contained in:
@@ -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(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user