[r21279]relationship.py: Fix not registering "en_GB" as english.
Also replace diagnostic print with proper logging. svn: r21418
This commit is contained in:
parent
bfa28faf55
commit
088c97106f
@ -30,6 +30,9 @@ Classes for relationships.
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
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
|
# 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_
|
||||||
# If so return standard relationship calculator.
|
# If so return standard relationship calculator.
|
||||||
if lang == "en":
|
if lang.startswith("en"):
|
||||||
return __RELCALC_CLASS()
|
return __RELCALC_CLASS()
|
||||||
# set correct non English relationship calculator based on lang
|
# set correct non English relationship calculator based on lang
|
||||||
relation_translation_found = False
|
relation_translation_found = False
|
||||||
@ -1811,8 +1814,8 @@ def get_relationship_calculator(reinit=False):
|
|||||||
break
|
break
|
||||||
if not relation_translation_found and \
|
if not relation_translation_found and \
|
||||||
len(PluginRegister.get_instance().relcalc_plugins()):
|
len(PluginRegister.get_instance().relcalc_plugins()):
|
||||||
print((("No translation available for language '%s'. " +
|
LOG.debug(_("No translation available for language '%s'. " +
|
||||||
"Using 'english' instead.") % lang))
|
"Using 'english' instead.") % lang)
|
||||||
return __RELCALC_CLASS()
|
return __RELCALC_CLASS()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user