fix some TB: #1605
This commit is contained in:
parent
fff4cccb7d
commit
1a70f43712
|
@ -41,13 +41,15 @@ locale.setlocale(locale.LC_ALL, '')
|
||||||
# get LANG, fallback to ''; LANG can be 'en_US:el_GR.UTF-8:fr_FR'
|
# get LANG, fallback to ''; LANG can be 'en_US:el_GR.UTF-8:fr_FR'
|
||||||
lang = os.environ.get('LANG', '')
|
lang = os.environ.get('LANG', '')
|
||||||
default_loc = locale.getdefaultlocale()[0] # en_US, fr_FR, el_GR etc..
|
default_loc = locale.getdefaultlocale()[0] # en_US, fr_FR, el_GR etc..
|
||||||
if default_loc not in lang.split(':'): # is the default locale a value of LANG?
|
# is the default locale a value of LANG?
|
||||||
|
if default_loc and default_loc not in lang.split(':'):
|
||||||
# no, add it!
|
# no, add it!
|
||||||
if lang == '':
|
if lang == '':
|
||||||
lang = default_loc
|
lang = default_loc
|
||||||
else:
|
else:
|
||||||
lang += ':' + default_loc
|
lang += ':' + default_loc
|
||||||
|
|
||||||
|
if lang:
|
||||||
os.environ['LANG'] = lang
|
os.environ['LANG'] = lang
|
||||||
|
|
||||||
_translation = None
|
_translation = None
|
||||||
|
|
Loading…
Reference in New Issue