From 105d3f8dbb6e9bc5149d53a7d8f0851ad3d001c8 Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Wed, 27 Jun 2018 15:50:41 +0200 Subject: [PATCH] fix inexisting LANG=en_US.utf8 --- .../Application/config/splash_generator/splash2.py | 7 ++++++- src/salomeTools.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/templates/Application/config/splash_generator/splash2.py b/data/templates/Application/config/splash_generator/splash2.py index 476904d..1521075 100755 --- a/data/templates/Application/config/splash_generator/splash2.py +++ b/data/templates/Application/config/splash_generator/splash2.py @@ -6,7 +6,12 @@ import os, sys -__LANG__=os.getenv("LANG") + +try: + __LANG__ = os.environ["LANG"] # original locale +except: + __LANG__ = "en_US.utf8" #default + __FR__={ "This script requires the Image, ImageDraw and ImageFont libraries": "Ce script a besoin de Image, ImageDraw et ImageFont python librairies", diff --git a/src/salomeTools.py b/src/salomeTools.py index ef3857e..1ad0b02 100755 --- a/src/salomeTools.py +++ b/src/salomeTools.py @@ -65,7 +65,10 @@ import commands.config as CONFIG # load resources for internationalization gettext.install("salomeTools", os.path.join(srcdir, "i18n")) -_LANG = os.environ["LANG"] # original locale +try: + _LANG = os.environ["LANG"] # original locale +except: + _LANG = "en_US.utf8" #default # The possible hooks : # pre is for hooks to be executed before commands -- 2.39.2