This commit is contained in:
Manuel Cortez 2017-08-06 11:22:14 -05:00
parent a073a5caaa
commit 5b47e8806a
2 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,7 @@
* When authorising an account, you will see a dialogue with a cancel button, in case you want to abort the process. Also, NVDA will not be blocked when the process starts. ([#101](https://github.com/manuelcortez/TWBlue/issues/101))
* In the translator module, the list of available languages is fetched automatically from the provider. That means all of these languages will work and there will not be inconsistencies. Also we've removed the first combo box, because the language is detected automatically by Yandex'S API. ([#153](https://github.com/manuelcortez/TWBlue/issues/153))
* And more. ([#156](https://github.com/manuelcortez/TWBlue/issues/156))
## changes in version 0.91 and 0.92

View File

@ -26,8 +26,7 @@ class searchDialog(baseDialog.BaseWXDialog):
radioSizer.Add(self.users, 0, wx.ALL, 5)
sizer.Add(radioSizer, 0, wx.ALL, 5)
lang = wx.StaticText(panel, -1, _(u"&Language for results: "))
langs = [x[1] for x in translator.translator.available_languages()]
langs[:] = langs[1:]
langs = [x for x in translator.translator.languages.values()]
langs.insert(0, _(u"any"))
self.lang = wx.ComboBox(panel, -1, choices=langs, value=langs[0], style = wx.CB_READONLY)
langBox = wx.BoxSizer(wx.HORIZONTAL)
@ -51,7 +50,12 @@ class searchDialog(baseDialog.BaseWXDialog):
self.SetClientSize(sizer.CalcMin())
def get_language(self):
return [x[0] for x in translator.translator.available_languages()][self.lang.GetSelection()]
l = self.lang.GetStringSelection()
if l == _(u"any"):
return ""
for langcode, langname in translator.translator.languages.iteritems():
if langname == l:
return langcode
def get_result_type(self):
r = self.resultstype.GetValue()