Skip to content

Commit

Permalink
✨ Fix translation result
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed May 4, 2024
1 parent 03fba41 commit 4dd7bec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/utility/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def translate_text(self, text: str):
data = await response.json()
sentences = data["sentences"][0]["trans"]

return sentences
return "".join(sentence.get("trans", "") for sentence in sentences)
except Exception:
return "Some error happened :("

Expand Down

0 comments on commit 4dd7bec

Please sign in to comment.