From 8aedb0160841ca4b650c454e53b9b54d42a498ee Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Thu, 4 Feb 2010 12:38:57 +0000 Subject: [PATCH] Translation even if LANG missing or set wrong. svn: r14207 --- src/Relationship.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Relationship.py b/src/Relationship.py index 2300bd29c..8ae69a9c1 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -1788,13 +1788,19 @@ def get_relationship_calculator(reinit=False): lang = ' ' try: lang = os.environ["LANG"] + _LANG_SET = True except: import locale lang = locale.getlocale()[0] + _LANG_SET = False __RELCALC_CLASS = RelationshipCalculator # set correct relationship calculator based on LANG for plugin in PluginRegister.get_instance().relcalc_plugins(): + if not lang in plugin.lang_list and _LANG_SET: + # LANG set but with non recognizable language info. Try getlocale + import locale + lang = locale.getlocale()[0] if lang in plugin.lang_list: pmgr = BasePluginManager.get_instance() # the loaded module is put in variable mod