[r21326] GrampsLocale: Correct setting GrampsLocale.languages
Test only first 5 or first 2 characters of the language id against the list of available translations. Thanks to Tim Lyons for exposing the error. svn: r21423
This commit is contained in:
parent
0bbbc76852
commit
400523c7f3
@ -118,11 +118,12 @@ class GrampsLocale(object):
|
||||
|
||||
if not language or len(language) == 0:
|
||||
if "LANGUAGE" in os.environ:
|
||||
avail = self.get_available_translations()
|
||||
language = [l for l in os.environ["LANGUAGE"].split(":")
|
||||
if l in self.get_available_translations()]
|
||||
if l[:5] in avail or l[:2] in avail]
|
||||
self.language = language
|
||||
elif not lang == "C.UTF-8":
|
||||
self.language = [lang[0:2]]
|
||||
self.language = [lang]
|
||||
else:
|
||||
self.language = ["en"]
|
||||
|
||||
|
@ -247,9 +247,9 @@ def mac_setup_localization(glocale, lang, language):
|
||||
if not language or len(language) == 0:
|
||||
if "LANGUAGE" in os.environ:
|
||||
language = [l for l in os.environ["LANGUAGE"].split(":")
|
||||
if l in available]
|
||||
if l[:5] in available or l[:2] in available]
|
||||
elif lang != "en_US":
|
||||
language = [lang[0:2]]
|
||||
language = [lang]
|
||||
else:
|
||||
if len(translations) > 0:
|
||||
language = translations
|
||||
|
Loading…
Reference in New Issue
Block a user