From 221c30976f870f166d3e54e919fded2b6841d9bc Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 24 Feb 2013 00:51:38 +0000 Subject: [PATCH] [r21145][Bug 6222]: Get the addons language list from the primary GrampsLocale instance. svn: r21393 --- gramps/gen/utils/grampslocale.py | 8 ++++++++ gramps/gui/viewmanager.py | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index 1961f822e..9761f2e35 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -147,6 +147,14 @@ class GrampsLocale(object): """ return self.localedomain + def get_language_list(self): + """ + Return the list of configured languages. Used by + ViewManager.check_for_updates to select the language for the + addons descriptions. + """ + return self.language + def _get_translation(self, domain = None, localedir = None, languages=None): diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 5db4e885c..f5543f5c6 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -372,13 +372,7 @@ class ViewManager(CLIManager): from urllib.request import urlopen import locale LOG.debug("Checking for updated addons...") - langs = [] - lang = locale.getlocale()[0] # not None - if lang: - langs.append(lang) - if "_" in lang: - lang, variation = lang.split("_", 1) - langs.append(lang) + langs = glocale.get_language_list() langs.append("en") # now we have a list of languages to try: fp = None