eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/GoogleV1Engine.py

changeset 7748
23e98236a4c4
parent 7360
9190402e4505
child 7780
41420f82c0ac
diff -r 4f0b034f4c34 -r 23e98236a4c4 eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/GoogleV1Engine.py
--- a/eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/GoogleV1Engine.py	Sat Oct 03 18:10:49 2020 +0200
+++ b/eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/GoogleV1Engine.py	Sat Oct 03 18:11:45 2020 +0200
@@ -95,7 +95,7 @@
                 response = re.sub(r',{2,}', ',', response)
                 responseDict = json.loads(response)
             except ValueError:
-                return self.tr("Invalid response received"), False
+                return self.tr("Google V1: Invalid response received"), False
             
             if isinstance(responseDict, dict):
                 sentences = responseDict["sentences"]
@@ -132,7 +132,7 @@
                     len(responseDict) > 2
                 ):
                     if not responseDict[1]:
-                        result = self.tr("No translation found.")
+                        result = self.tr("Google V1: No translation found.")
                         ok = False
                     else:
                         for wordTypeList in responseDict[1]:
@@ -162,7 +162,8 @@
         """
         text = text.split("\n\n", 1)[0]
         if len(text) > self.TextToSpeechLimit:
-            return (self.tr("Only texts up to {0} characters are allowed.")
+            return (self.tr("Google V1: Only texts up to {0} characters are"
+                            " allowed.")
                     .format(self.TextToSpeechLimit), False)
         
         url = QUrl(self.TextToSpeechUrl +

eric ide

mercurial