From 67e5b55c1a6144bd75f3d4bb4267156ab1c69719 Mon Sep 17 00:00:00 2001 From: Jussi Timperi Date: Sat, 3 Oct 2015 01:06:18 +0300 Subject: [PATCH] Google: Handle empty results in translate. --- plugins/Google/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 388bd471e..5680a2480 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -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):