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: |