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

Repaired Google Translate Integration #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rogiervandenberg
Copy link

Recently the Workflow stopped working due to:

{ Error
at /home/xiangying/server/core/node_modules/_google-translate-api@2.3.0@google-translate-api/index.js:105:17
at
at process._tickCallback (internal/process/next_tick.js:188:7) code: 'BAD_REQUEST' }

It seemed that something was changed at the Google side, and the used "google-translate-api" is not maintained anymore. I have upgraded the project to the better "@vitalets/google-translate-api" package + I have changed and added some documentation.

@zetavg
Copy link
Owner

zetavg commented Jul 1, 2020

Thanks for your PR!

However, I got the following error when I try to run ./translate.js auto zh-TW hi:

Projects/alfred-google-translate-workflow/node_modules/@vitalets/google-translate-api/node_modules/got/source/create.js:61
	got.stream = (url, options) => got(url, {...options, stream: true});
	                                         ^^^
SyntaxError: Unexpected token ...
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/z/Projects/alfred-google-translate-workflow/node_modules/@vitalets/google-translate-api/node_modules/got/source/index.js:3:16)
    at Module._compile (module.js:570:32)

I think it's because the published @vitalets/google-translate-api haven't been Babel-transpiled and might need a very new version of NodeJS. We might need to setup Babel to transform it.

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