From 050cffac8ae46f8cbf87a3d415bd42aacb9dd484 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 21 Feb 2006 09:34:34 +0000 Subject: [PATCH] add default local lang to LANG environment variable. Fixes #1324 --- src/common/i18n.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/i18n.py b/src/common/i18n.py index 7a6133543..ec1da2e70 100644 --- a/src/common/i18n.py +++ b/src/common/i18n.py @@ -36,6 +36,16 @@ else: # set '' so each part of the locale that should be modified is set # according to the environment variables 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 def init():