Show progress of translations
This commit is contained in:
@@ -102,9 +102,14 @@ class PFGeneralPref(PreferenceView):
|
||||
self.stLangLabel.Wrap(-1)
|
||||
langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.langChoices = sorted([v for x, v in LocaleSettings.supported_langauges().items()], key=lambda x: x.Description)
|
||||
self.langChoices = sorted([langInfo for lang, langInfo 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)
|
||||
def langDisplay(langInfo):
|
||||
progress = self.localeSettings.get_progress(langInfo.CanonicalName)
|
||||
progress_display = (" ({}%)".format(progress['translated_progress']) if progress is not None else "")
|
||||
return langInfo.Description + progress_display
|
||||
|
||||
self.chLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [langDisplay(x) for x in self.langChoices], 0)
|
||||
self.chLang.Bind(wx.EVT_CHOICE, self.onLangSelection)
|
||||
|
||||
selectedIndex = self.langChoices.index(next((x for x in self.langChoices if x.CanonicalName == self.localeSettings.get('locale')), None))
|
||||
|
||||
Reference in New Issue
Block a user