From 750331b8bdbfc3223233167bd3ee9557dedc1f88 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 29 Oct 2009 22:12:11 +0000 Subject: [PATCH] 3325: Gramps (from trunc) chrashes without an environment definition for LANG svn: r13460 --- src/Relationship.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Relationship.py b/src/Relationship.py index 39ceddef7..e8e4761df 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -1760,10 +1760,17 @@ def get_relationship_calculator(reinit=False): global __RELCALC_CLASS if __RELCALC_CLASS is None or reinit: + lang = ' ' + try: + lang = os.environ["LANG"] + except: + import locale + lang = locale.getlocale()[0] + __RELCALC_CLASS = RelationshipCalculator # set correct relationship calculator based on LANG for plugin in PluginRegister.get_instance().relcalc_plugins(): - if os.environ["LANG"] in plugin.lang_list: + if lang in plugin.lang_list: pmgr = BasePluginManager.get_instance() # the loaded module is put in variable mod mod = pmgr.load_plugin(plugin)