add default local lang to LANG environment variable. Fixes #1324
This commit is contained in:
parent
3317383918
commit
050cffac8a
|
@ -36,6 +36,16 @@ else:
|
||||||
# set '' so each part of the locale that should be modified is set
|
# set '' so each part of the locale that should be modified is set
|
||||||
# according to the environment variables
|
# according to the environment variables
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
# Add LANG to os.environ
|
||||||
|
l = os.environ.get('LANG')
|
||||||
|
if not l:
|
||||||
|
l = ''
|
||||||
|
default_l = locale.getdefaultlocale()[0]
|
||||||
|
if not default_l in l.split(':'):
|
||||||
|
l += ':' + default_l
|
||||||
|
if l[0] == ':': #remove the forst :
|
||||||
|
l = l[1:]
|
||||||
|
os.environ['LANG'] = l
|
||||||
_translation = None
|
_translation = None
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
|
|
Loading…
Reference in New Issue