Skip to content

Add the ability to translate text#8

Open
DirkyJerky wants to merge 7 commits intoMcSpider:masterfrom
DirkyJerky:master
Open

Add the ability to translate text#8
DirkyJerky wants to merge 7 commits intoMcSpider:masterfrom
DirkyJerky:master

Conversation

@DirkyJerky
Copy link
Contributor

Todo: Allow to translate last typed line from another user

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You appear to have removed the space in-between the " ", since this is the string joining the message parts the translation fails.
The nonTranslated string also needs to be URL encoded before passing it on to requests.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a NameError: global name 'langList' is not defined exception.

The syntax and langList variables need to be referenced with self.langList or self.syntax since they belong to the class.

On the unicode and utf-8 thing for .sendMsg, would changing str(translated) to translated.decode('utf-8') work? Im confused
--amend for github browser mode pls
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be checked against jsonObj["responseDetails"] instead of jsonObj["responseData"]["translatedText"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants