Bug 7002: Gramps crashes when environment varable LANG is not set to C

Force $LANG to have UTF-8 suffix.

svn: r22878
This commit is contained in:
John Ralls 2013-08-19 21:23:17 +00:00
parent 6b9ea867ee
commit da460a4b97

View File

@ -85,6 +85,10 @@ else:
logging.warning('Unable to determine your Locale, using English') logging.warning('Unable to determine your Locale, using English')
lang = 'en.UTF-8' lang = 'en.UTF-8'
_lang_ = lang.replace('@', '.').split('.')
if not (len(_lang_) == 2 and _lang_[1] == 'UTF-8'):
lang = _lang_[0] + '.UTF-8'
os.environ["LANG"] = lang os.environ["LANG"] = lang
os.environ["LANGUAGE"] = lang os.environ["LANGUAGE"] = lang