Google: Handle empty results in translate.

This commit is contained in:
Jussi Timperi 2015-10-03 01:06:18 +03:00
parent 85ee37c162
commit 67e5b55c1a
1 changed files with 4 additions and 1 deletions

View File

@ -267,7 +267,10 @@ class Google(callbacks.PluginRegexp):
except:
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
def translate(self, irc, msg, args, sourceLang, targetLang, text):