From d6f9af95ad17eee4c796f3ee91aa9aa87eab9ed4 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 3 Feb 2013 01:22:59 +0000 Subject: [PATCH] relationship.py: Fix not registering "en_GB" as english. Also replace diagnostic print with proper logging. svn: r21279 --- gramps/gen/relationship.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py index bc121cfa8..b3fa2218c 100644 --- a/gramps/gen/relationship.py +++ b/gramps/gen/relationship.py @@ -30,6 +30,9 @@ Classes for relationships. from __future__ import print_function import os +import logging +LOG = logging.getLogger("gen.relationship") +LOG.addHandler(logging.StreamHandler()) #------------------------------------------------------------------------- # @@ -1796,7 +1799,7 @@ def get_relationship_calculator(reinit=False): # If lang not set default to English relationship calulator # See if lang begins with en_, English_ or english_ # If so return standard relationship calculator. - if lang == "en": + if lang.startswith("en"): return __RELCALC_CLASS() # set correct non English relationship calculator based on lang relation_translation_found = False @@ -1811,8 +1814,8 @@ def get_relationship_calculator(reinit=False): break if not relation_translation_found and \ len(PluginRegister.get_instance().relcalc_plugins()): - print((("No translation available for language '%s'. " + - "Using 'english' instead.") % lang)) + LOG.debug(_("No translation available for language '%s'. " + + "Using 'english' instead.") % lang) return __RELCALC_CLASS() #-------------------------------------------------------------------------