summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2008-11-21 14:31:37 +0100
committerChristophe Simonis <christophe@tinyerp.com>2008-11-21 14:31:37 +0100
commitff02f6456fb4d10a6b4c598acb7c15c8da4e8600 (patch)
tree6000759d3a4eabaaee93360b21557b6bc30952c6
parentc0a3eea8998ec726a50411f48bc5fd4d88ae975f (diff)
[FIX] Better format detection when importing lang files
lp bug: https://launchpad.net/bugs/300624 fixed bzr revid: christophe@tinyerp.com-20081121133137-kku630y4tao1axwm
-rw-r--r--bin/addons/base/module/wizard/wizard_import_lang.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/addons/base/module/wizard/wizard_import_lang.py b/bin/addons/base/module/wizard/wizard_import_lang.py
index 82b67ab2ae4..3a195b19747 100644
--- a/bin/addons/base/module/wizard/wizard_import_lang.py
+++ b/bin/addons/base/module/wizard/wizard_import_lang.py
@@ -31,12 +31,13 @@ view_form="""<?xml version="1.0"?>
<image name="gtk-dialog-info" colspan="2"/>
<group colspan="2" col="4">
<separator string="Import new language" colspan="4"/>
- <field name="name"/>
+ <field name="name" width="200"/>
<field name="code"/>
- <field name="data" colspan="3"/>
+ <field name="data" colspan="4"/>
<label string="You have to import a .CSV file wich is encoded in UTF-8.\n
-Please check that the first line of your file is:" colspan="4" align="0.0"/>
+Please check that the first line of your file is one of the following:" colspan="4" align="0.0"/>
<label string="type,name,res_id,src,value" colspan="4"/>
+ <label string="module,type,name,res_id,src,value" colspan="4"/>
<label string="You can also import .po files." colspan="4" align="0.0"/>
</group>
</form>"""
@@ -56,7 +57,7 @@ class wizard_import_lang(wizard.interface):
# now we determine the file format
fileobj.seek(0)
- first_line = fileobj.readline().strip()
+ first_line = fileobj.readline().strip().replace('"', '').replace(' ', '')
fileformat = first_line.endswith("type,name,res_id,src,value") and 'csv' or 'po'
fileobj.seek(0)