Finish up the dynamic translations

This commit is contained in:
blitzmann
2020-07-24 21:59:38 -04:00
parent ac1e6fe5b7
commit 1fe83ddcdf
5 changed files with 29 additions and 38 deletions

View File

@@ -102,12 +102,13 @@ class PFGeneralPref(PreferenceView):
self.stLangLabel.Wrap(-1)
langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.langChoices = sorted([wx.Locale.FindLanguageInfo(x) for x in wx.Translations.Get().GetAvailableTranslations('lang')], key=lambda x: x.Description)
self.langChoices = sorted([v for x, v in LocaleSettings.supported_langauges().items()], key=lambda x: x.Description)
self.chLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [x.Description for x in self.langChoices], 0)
self.chLang.Bind(wx.EVT_CHOICE, self.onLangSelection)
self.chLang.SetStringSelection(self.localeSettings.get('locale'))
selectedIndex = self.langChoices.index(next((x for x in self.langChoices if x.CanonicalName == self.localeSettings.get('locale')), None))
self.chLang.SetSelection(selectedIndex)
langSizer.Add(self.chLang, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
langBox.Add(langSizer)