diff --git a/doc/changelog.md b/doc/changelog.md index 441b7b03..ddbcb917 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -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 diff --git a/src/wxUI/dialogs/search.py b/src/wxUI/dialogs/search.py index e04f07c6..12849117 100644 --- a/src/wxUI/dialogs/search.py +++ b/src/wxUI/dialogs/search.py @@ -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()