diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index ee7d30d19..c73bc69e6 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -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"] diff --git a/gramps/gen/utils/maclocale.py b/gramps/gen/utils/maclocale.py index 0a3f7f7fb..4610faef0 100644 --- a/gramps/gen/utils/maclocale.py +++ b/gramps/gen/utils/maclocale.py @@ -250,9 +250,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