-
Notifications
You must be signed in to change notification settings - Fork 36
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 API error & tests #11
base: master
Are you sure you want to change the base?
Conversation
Stop using Grunt
Tests are still failing because of hubot-archive#7 (Google changed its API) Add dependencies to be able to wait for the API response Used translations which are unlikely to change
while we wait for hubot-archive/hubot-google-translate#11 to be merged
@technicalpickles Did you get a chance to look into this? |
I haven't, but I'm not the only maintainer on this.
Why? Grunt is used for releasing in addition to tests. |
I'm looking briefly at the new functions added, and I'm having a real hard time understanding them. I would recommend using intention revealing variable names instead of one or two letter variables. I'm also not sure what |
Sorry for the direct ping. I wasn't sure anyone was receiving notifications for issues/PR opened on this repository and it's rather difficult to identify the maintainers of a repository 😕
The "Grunt tests" weren't working (some dependency issue at least).
This piece of code you're referring to has been extracted directly from Google's compressed JS code. I don't think there is a documentation on that and I'm not sure of the actual purpose of |
The code is directly extracted from the google translate js page. There is no point is documenting this part, or having a proper variable naming, as it can change soon for another completely different piece of code. Furthermore, this is not documented anywhere in the API. |
This pull request first fixes the tests:
.travis.yml
file.Then, @awailly was able to fix the API error (#7) 🙇
He extracted a necessary piece of code from Google JS code in order to compute one of the request parameters. More explanations can be found at soimort/translate-shell#94.
The new tests are more functional tests than unit tests but this will enable us to track any breaking change in Google Translate's API. I also used tests sentences which are fairly unlikely to change.
You will need to enable Travis tests on the repository to run the tests. In the meantime, you can see the results here ;)
EDIT: For a temporary fix, you can use the following in your project: