From 8fe756f5e45ca3a3b194e943802049af22e60e8b Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 2 Apr 2013 20:35:51 +0000 Subject: [PATCH] [r21854]GrampsLocale: Win: Check both forward and reverse mslocale svn: r21857 --- gramps/gen/utils/grampslocale.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index b3a8e5d0f..83917eeae 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -174,8 +174,7 @@ class GrampsLocale(object): if not (hasattr(self, 'lang') and self.lang): self.lang = None if 'LANG' in os.environ: - lang = os.environ['LANG'] - (lang, loc) = _check_mswin_locale(lang) + (lang, loc) = _check_mswin_locale(os.environ['LANG']) if loc: locale.setlocale(locale.LC_ALL, '.'.join(loc)) self.lang = lang @@ -190,6 +189,10 @@ class GrampsLocale(object): self.lang = loc[0] self.languages = [loc[0]] self.encoding = loc[1] + elif ((lang, loc) = _check_mswin_locale(lang)): + self.lang = lang + self.language = [self.lang] + self.encoding = loc[1] if not self.lang: self.lang = 'C'