[r23011]Bug 7036: [Win32]Setting LANG crashes Gramps
Also fixes Bug 6919: No automatic language selection in Windows Thanks to Helge Herz. svn: r23012
This commit is contained in:
parent
4b7c9361e0
commit
f088797e9f
@ -105,11 +105,11 @@ _LOCALE_NAMES = {
|
|||||||
def _check_mswin_locale(locale):
|
def _check_mswin_locale(locale):
|
||||||
msloc = None
|
msloc = None
|
||||||
try:
|
try:
|
||||||
msloc = _LOCALE_NAMES[locale[:5]]
|
msloc = _LOCALE_NAMES[locale[:5]][:2]
|
||||||
locale = locale[:5]
|
locale = locale[:5]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
try:
|
try:
|
||||||
msloc = _LOCALE_NAMES[locale[:2]]
|
msloc = _LOCALE_NAMES[locale[:2]][:2]
|
||||||
locale = locale[:2]
|
locale = locale[:2]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return (None, None)
|
return (None, None)
|
||||||
@ -195,7 +195,7 @@ class GrampsLocale(object):
|
|||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
(lang, encoding) = locale.getlocale()
|
(lang, encoding) = locale.getlocale()
|
||||||
loc = _check_mswin_locale_reverse(lang)
|
loc = _check_mswin_locale_reverse(lang)
|
||||||
if loc:
|
if loc[0]:
|
||||||
self.lang = loc[0]
|
self.lang = loc[0]
|
||||||
self.encoding = loc[1]
|
self.encoding = loc[1]
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user