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

changeset 7256
4ef3b78ebb4e
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7255:d595f6f9cbf8 7256:4ef3b78ebb4e
80 try: 80 try:
81 responseDict = json.loads(response) 81 responseDict = json.loads(response)
82 except ValueError: 82 except ValueError:
83 return self.tr("Invalid response received"), False 83 return self.tr("Invalid response received"), False
84 84
85 if "data" not in responseDict or \ 85 if (
86 "translations" not in responseDict["data"]: 86 "data" not in responseDict or
87 "translations" not in responseDict["data"]
88 ):
87 return self.tr("No translation available."), False 89 return self.tr("No translation available."), False
88 90
89 result = "" 91 result = ""
90 translations = responseDict["data"]["translations"] 92 translations = responseDict["data"]["translations"]
91 for translation in translations: 93 for translation in translations:

eric ide

mercurial