Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix qoogle translate URL and query params #7

Merged
merged 8 commits into from
Aug 2, 2015
Merged

Fix qoogle translate URL and query params #7

merged 8 commits into from
Aug 2, 2015

Conversation

sparrovv
Copy link
Owner

@sparrovv sparrovv commented Aug 2, 2015

Google has changed its API endpoints, this fixes gotr translation.

The speech synthesis seems to be broken, and can't find a good way to fix it atm.


req, err := http.NewRequest("POST", urlObj.String(), nil)
check(err)

req.Header.Add("User-Agent", "Mozilla/5.0")
req.Header.Add("User-Agent", "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36")
Copy link

Choose a reason for hiding this comment

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

:D

Copy link
Owner Author

Choose a reason for hiding this comment

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

I doubt it improves anything, but added it just in case :-)

When a env var is set, it will log to stdout requests and responses from
google translate
It's a good practice, and it's for me to remember what I've been working
on
@sparrovv sparrovv merged commit 9e8ce79 into master Aug 2, 2015
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