mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Merge pull request #1171 from Ban3/translate-crash-fix
Google: Handle empty results in translate.
This commit is contained in:
commit
346ee8e6b9
@ -267,7 +267,10 @@ class Google(callbacks.PluginRegexp):
|
|||||||
except:
|
except:
|
||||||
language = 'unknown'
|
language = 'unknown'
|
||||||
|
|
||||||
return (''.join(x[0] for x in data[0]), language)
|
if data[0]:
|
||||||
|
return (''.join(x[0] for x in data[0]), language)
|
||||||
|
else:
|
||||||
|
return (_('No translations found.'), language)
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def translate(self, irc, msg, args, sourceLang, targetLang, text):
|
def translate(self, irc, msg, args, sourceLang, targetLang, text):
|
||||||
|
Loading…
Reference in New Issue
Block a user