GrampsLocale: Win: Check both forward and reverse mslocale
svn: r21854
This commit is contained in:
parent
4dc31ff808
commit
ea9ddaba69
@ -174,8 +174,7 @@ class GrampsLocale(object):
|
|||||||
if not (hasattr(self, 'lang') and self.lang):
|
if not (hasattr(self, 'lang') and self.lang):
|
||||||
self.lang = None
|
self.lang = None
|
||||||
if 'LANG' in os.environ:
|
if 'LANG' in os.environ:
|
||||||
lang = os.environ['LANG']
|
(lang, loc) = _check_mswin_locale(os.environ['LANG'])
|
||||||
(lang, loc) = _check_mswin_locale(lang)
|
|
||||||
if loc:
|
if loc:
|
||||||
locale.setlocale(locale.LC_ALL, '.'.join(loc))
|
locale.setlocale(locale.LC_ALL, '.'.join(loc))
|
||||||
self.lang = lang
|
self.lang = lang
|
||||||
@ -190,6 +189,10 @@ class GrampsLocale(object):
|
|||||||
self.lang = loc[0]
|
self.lang = loc[0]
|
||||||
self.languages = [loc[0]]
|
self.languages = [loc[0]]
|
||||||
self.encoding = loc[1]
|
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:
|
if not self.lang:
|
||||||
self.lang = 'C'
|
self.lang = 'C'
|
||||||
|
Loading…
Reference in New Issue
Block a user