From 73d1d080b54208b1106e3332e424c1ad52da98b6 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 4 May 2013 20:23:47 +0000 Subject: [PATCH] GrampsLocale: When checking translations check full locale first So that e.g. en_GB will be preferred over en if en_GB is in fact the desired translation. svn: r22173 --- gramps/gen/utils/grampslocale.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index 606e941ba..5d6da0c77 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -39,7 +39,7 @@ _hdlr = None # GrampsLocale initialization comes before command-line argument # passing, so one must set the log level directly. The default is # logging.WARN. Uncomment the following to change it to logging.DEBUG: -# LOG.setLevel(logging.DEBUG) +LOG.setLevel(logging.DEBUG) try: from icu import Locale, Collator HAVE_ICU = True @@ -831,10 +831,10 @@ class GrampsLocale(object): if not locale: return None - if locale[:2] in self.languages: - return locale[:2] if locale[:5] in self.languages: return locale[:5] + if locale[:2] in self.languages: + return locale[:2] return None