Bring language selection to the forefront before wx app initialization
This commit is contained in:
@@ -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
|
||||
|
||||
4
pyfa.py
4
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():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user