Bug 9159: Date format does not match system.
Make US English a special-case locale with en_GB the default if the locale is en_XX where XX != US. Note that untranslated languages will still end up using the 'C' locale.
This commit is contained in:
parent
36da63b33e
commit
54e8ea0e39
@ -120,6 +120,10 @@ def _check_mswin_locale(locale):
|
|||||||
msloc = _LOCALE_NAMES[locale[:2]][:2]
|
msloc = _LOCALE_NAMES[locale[:2]][:2]
|
||||||
locale = locale[:2]
|
locale = locale[:2]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
#US English is the outlier, all other English locales want
|
||||||
|
#real English:
|
||||||
|
if locale[:2] == ('en') and locale[:5] != 'en_US':
|
||||||
|
return ('en_GB', '1252')
|
||||||
return (None, None)
|
return (None, None)
|
||||||
return (locale, msloc)
|
return (locale, msloc)
|
||||||
|
|
||||||
@ -127,7 +131,9 @@ def _check_mswin_locale_reverse(locale):
|
|||||||
for (loc, msloc) in _LOCALE_NAMES.items():
|
for (loc, msloc) in _LOCALE_NAMES.items():
|
||||||
if msloc and locale == msloc[0]:
|
if msloc and locale == msloc[0]:
|
||||||
return (loc, msloc[1])
|
return (loc, msloc[1])
|
||||||
|
#US English is the outlier, all other English locales want real English:
|
||||||
|
if locale.startswith('English') and locale != 'English_United States':
|
||||||
|
return ('en_GB', '1252')
|
||||||
return (None, None)
|
return (None, None)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
@ -284,6 +290,8 @@ class GrampsLocale(object):
|
|||||||
if not locale[0]:
|
if not locale[0]:
|
||||||
return False
|
return False
|
||||||
lang = self.check_available_translations(locale[0])
|
lang = self.check_available_translations(locale[0])
|
||||||
|
if not lang and locale[0].startswith('en'):
|
||||||
|
locale[0] = lang = 'en_GB'
|
||||||
if not lang:
|
if not lang:
|
||||||
return False
|
return False
|
||||||
self.lang = locale[0]
|
self.lang = locale[0]
|
||||||
@ -795,9 +803,11 @@ class GrampsLocale(object):
|
|||||||
|
|
||||||
if locale[:5] in self.languages:
|
if locale[:5] in self.languages:
|
||||||
return locale[:5]
|
return locale[:5]
|
||||||
|
#US English is the outlier, all other English locales want real English:
|
||||||
|
if locale[:2] == 'en' and locale[:5] != 'en_US':
|
||||||
|
return 'en_GB'
|
||||||
if locale[:2] in self.languages:
|
if locale[:2] in self.languages:
|
||||||
return locale[:2]
|
return locale[:2]
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_language_dict(self):
|
def get_language_dict(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user