summaryrefslogtreecommitdiff
path: root/bin/tinyerp-server.py
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2008-07-22 09:38:43 +0200
committerChristophe Simonis <christophe@tinyerp.com>2008-07-22 09:38:43 +0200
commit63ceebdf364bc1e08a580dc994c7d18f708fc619 (patch)
tree86fad8e491d0054dd6f753fe4f8d06d0f717d0ce /bin/tinyerp-server.py
parent2ccf0092a7e78b766a03475feedc12ca6c6dc21a (diff)
i18n: allow export into a po file from command line
bzr revid: christophe@tinyerp.com-20080722073843-16r67df83yz8z0tb
Diffstat (limited to 'bin/tinyerp-server.py')
-rwxr-xr-xbin/tinyerp-server.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/tinyerp-server.py b/bin/tinyerp-server.py
index 8bdeec75bc6..c022188ff72 100755
--- a/bin/tinyerp-server.py
+++ b/bin/tinyerp-server.py
@@ -184,11 +184,12 @@ if tools.config["translate_out"]:
import csv
logger.notifyChannel("init", netsvc.LOG_INFO, 'writing translation file for language %s to %s' % (tools.config["language"], tools.config["translate_out"]))
- trans=tools.trans_generate(tools.config["language"], tools.config["translate_modules"])
- writer=csv.writer(file(tools.config["translate_out"], "w"), 'UNIX')
- for row in trans:
- writer.writerow(row)
- del trans
+
+ fileformat = os.path.splitext(tools.config["translate_out"])[-1][1:].lower()
+ buf = file(tools.config["translate_out"], "w")
+ tools.trans_export(tools.config["language"], tools.config["translate_modules"], buf, fileformat)
+ buf.close()
+
logger.notifyChannel("init", netsvc.LOG_INFO, 'translation file written succesfully')
sys.exit(0)