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
This commit is contained in:
parent
d5537ab93a
commit
73d1d080b5
@ -39,7 +39,7 @@ _hdlr = None
|
|||||||
# GrampsLocale initialization comes before command-line argument
|
# GrampsLocale initialization comes before command-line argument
|
||||||
# passing, so one must set the log level directly. The default is
|
# passing, so one must set the log level directly. The default is
|
||||||
# logging.WARN. Uncomment the following to change it to logging.DEBUG:
|
# logging.WARN. Uncomment the following to change it to logging.DEBUG:
|
||||||
# LOG.setLevel(logging.DEBUG)
|
LOG.setLevel(logging.DEBUG)
|
||||||
try:
|
try:
|
||||||
from icu import Locale, Collator
|
from icu import Locale, Collator
|
||||||
HAVE_ICU = True
|
HAVE_ICU = True
|
||||||
@ -831,10 +831,10 @@ class GrampsLocale(object):
|
|||||||
if not locale:
|
if not locale:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if locale[:2] in self.languages:
|
|
||||||
return locale[:2]
|
|
||||||
if locale[:5] in self.languages:
|
if locale[:5] in self.languages:
|
||||||
return locale[:5]
|
return locale[:5]
|
||||||
|
if locale[:2] in self.languages:
|
||||||
|
return locale[:2]
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user