From 51bedcd46c9af72847d09f7c24dc273c64d7acaf Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 7 May 2013 14:21:29 +0000 Subject: [PATCH] 6553: Local settings and reports and event editor Query the environment variables LC_TIME and LANG before resorting to getdefaultlocale() on Win32. svn: r22193 --- src/DateHandler/_DateHandler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DateHandler/_DateHandler.py b/src/DateHandler/_DateHandler.py index ebf6e6944..8ca17babc 100644 --- a/src/DateHandler/_DateHandler.py +++ b/src/DateHandler/_DateHandler.py @@ -57,7 +57,12 @@ import constfunc if not constfunc.win(): LANG = locale.getlocale(locale.LC_TIME)[0] else: - LANG = locale.getdefaultlocale(locale.LC_TIME)[0] + if 'LC_TIME' in os.environ: + LANG = os.environ['LC_TIME'] + elif 'LANG' in os.environ: + LANG = os.environ['LANG'] + 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.