fix some TB: #1605

This commit is contained in:
Yann Leboulanger 2006-02-22 06:39:47 +00:00
parent fff4cccb7d
commit 1a70f43712
1 changed files with 4 additions and 2 deletions

View File

@ -41,14 +41,16 @@ locale.setlocale(locale.LC_ALL, '')
# get LANG, fallback to ''; LANG can be 'en_US:el_GR.UTF-8:fr_FR'
lang = os.environ.get('LANG', '')
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!
if lang == '':
lang = default_loc
else:
lang += ':' + default_loc
os.environ['LANG'] = lang
if lang:
os.environ['LANG'] = lang
_translation = None