From 7187eb8ab6ceca64e5d4a49e9abbc2eb9315e6ee Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Tue, 7 May 2013 17:14:18 +0000 Subject: [PATCH] enable deferred translation for the relationship calculator svn: r22195 --- gramps/gen/relationship.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py index b1701baa2..0731d5edc 100644 --- a/gramps/gen/relationship.py +++ b/gramps/gen/relationship.py @@ -1787,14 +1787,20 @@ class RelationshipCalculator(object): __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. + + 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 if __RELCALC_CLASS is None or reinit: - lang = glocale.language[0] + lang = clocale.language[0] __RELCALC_CLASS = RelationshipCalculator # If lang not set default to English relationship calulator # See if lang begins with en_, English_ or english_