From 39d11f132bbb2d3b7f92de302eb9299368afb0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Thu, 21 Apr 2011 08:47:59 +0000 Subject: [PATCH] 4844: revert rev17071 svn: r17179 --- src/DateHandler/_DateHandler.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/DateHandler/_DateHandler.py b/src/DateHandler/_DateHandler.py index d82ee73b4..2da383bde 100644 --- a/src/DateHandler/_DateHandler.py +++ b/src/DateHandler/_DateHandler.py @@ -54,9 +54,10 @@ import constfunc # Constants # #------------------------------------------------------------------------- -LANG = '' -if "LANG" in os.environ: - LANG = os.environ["LANG"] +if not constfunc.win(): + LANG = locale.getlocale(locale.LC_TIME)[0] +else: + LANG = locale.getdefaultlocale(locale.LC_TIME)[0] # If LANG contains ".UTF-8" use only the part to the left of "." # Otherwise some date handler will not load. @@ -64,10 +65,8 @@ if ".UTF-8" in LANG.upper(): LANG = LANG.split(".")[0] if not LANG: - if not constfunc.win(): - LANG = locale.getlocale(locale.LC_TIME)[0] - else: - LANG = locale.getdefaultlocale(locale.LC_TIME)[0] + if "LANG" in os.environ: + LANG = os.environ["LANG"] if LANG: LANG_SHORT = LANG.split('_')[0]