From cd39593419c1e394369d7a9a4fc722f65788245a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Tue, 16 Jun 2015 13:53:02 +0200 Subject: [PATCH] Remove warning message associated to language on Ubuntu --- spyderlib/baseconfig.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spyderlib/baseconfig.py b/spyderlib/baseconfig.py index 72552276b10..7e57cec484f 100644 --- a/spyderlib/baseconfig.py +++ b/spyderlib/baseconfig.py @@ -307,11 +307,14 @@ def get_translation(modname, dirname=None): locale_path = get_module_data_path(dirname, relpath="locale", attr_name='LOCALEPATH') - # fixup environment var LANG, LANGUAGE + # If LANG is defined in ubuntu, a warning message is displayed, so in unix + # systems we define the LANGUAGE variable. language = load_lang_conf() - os.environ["LANG"] = language # Works on Windows - os.environ["LANGUAGE"] = language # Works on Linux - + if os.name == 'nt': + os.environ["LANG"] = language # Works on Windows + else: + os.environ["LANGUAGE"] = language # Works on Linux + import gettext try: _trans = gettext.translation(modname, locale_path, codeset="utf-8")