From 2214269ccaf1305bfe28548df140b0688e94898f Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sat, 20 Jun 2020 15:20:56 -0400 Subject: [PATCH] Bring language selection to the forefront before wx app initialization --- gui/app.py | 4 ++-- pyfa.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/app.py b/gui/app.py index 424c74963..33c1de232 100644 --- a/gui/app.py +++ b/gui/app.py @@ -5,6 +5,7 @@ from logbook import Logger pyfalog = Logger(__name__) from service.settings import LocaleSettings + class PyfaApp(wx.App): def OnInit(self): """ @@ -38,7 +39,7 @@ class PyfaApp(wx.App): #----------------------------------------------------------------------- - def UpdateLanguage(self, lang_override = None): + def UpdateLanguage(self, lang=None): """ Update the language to the requested one. @@ -53,7 +54,6 @@ class PyfaApp(wx.App): # Language domain. langDomain = "lang" - lang = lang_override or LocaleSettings.getInstance().get('locale') # Languages you want to support. supLang = LocaleSettings.supported_langauges diff --git a/pyfa.py b/pyfa.py index ea895a03f..c6a53a9fb 100755 --- a/pyfa.py +++ b/pyfa.py @@ -107,7 +107,9 @@ if __name__ == "__main__": config.loggingLevel = config.LOGLEVEL_MAP.get(options.logginglevel.lower(), config.LOGLEVEL_MAP['error']) config.defPaths(options.savepath) config.defLogging() - config.language = options.language + + from service.settings import LocaleSettings + config.language = options.language or LocaleSettings.getInstance().get('locale') with config.logging_setup.threadbound():