enable deferred translation for the relationship calculator

svn: r22194
This commit is contained in:
Paul Franklin 2013-05-07 17:13:56 +00:00
parent ded3b12080
commit 87306fcf57

View File

@ -1787,14 +1787,20 @@ class RelationshipCalculator(object):
__RELCALC_CLASS = None __RELCALC_CLASS = None
def get_relationship_calculator(reinit=False): def get_relationship_calculator(reinit=False, clocale=glocale):
""" """
Return the relationship calculator for the current language. Return the relationship calculator for the current language.
If clocale is passed in (a GrampsLocale) then that language will be used.
@param clocale: allow selection of the relationship language
@type clocale: a GrampsLocale instance
""" """
global __RELCALC_CLASS global __RELCALC_CLASS
if __RELCALC_CLASS is None or reinit: if __RELCALC_CLASS is None or reinit:
lang = glocale.language[0] lang = clocale.language[0]
__RELCALC_CLASS = RelationshipCalculator __RELCALC_CLASS = RelationshipCalculator
# If lang not set default to English relationship calulator # If lang not set default to English relationship calulator
# See if lang begins with en_, English_ or english_ # See if lang begins with en_, English_ or english_