From 26fb5e3022a4743f79721f2699cc8daaa2942e0c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 8 Jul 2008 08:13:12 +0000 Subject: [PATCH] * translation of nearly all exceptions * the export of translations per module take only the files of these modules [openobject-client @ chs@tinyerp.com-c19a9fd370d7ab1b2a465dca15de9ecf5f420d82] --- bin/translate.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/translate.py b/bin/translate.py index 577a36b5..355eef0f 100644 --- a/bin/translate.py +++ b/bin/translate.py @@ -109,11 +109,15 @@ def setlang(lang=None): gettext.install(APP, unicode=1) return False if lang: - lc, encoding = locale.getdefaultlocale() - if encoding == 'utf': + try: + lc, encoding = locale.getdefaultlocale() + if encoding == 'utf': + encoding = 'UTF-8' + if encoding == 'cp1252': + encoding = '1252' + except ValueError: encoding = 'UTF-8' - if encoding == 'cp1252': - encoding = '1252' + if os.name == 'nt' and lang != os.environ.get('LANG', ''): os.environ['LANG'] = lang if sys.executable == sys.argv[0]: -- 2.11.4.GIT