A translation webtask for use with Webtask's Slack Integration
- First install the webtask integration
- Then create a new slack webtask named translate (or anything you want):
/wt create translate
- In the generated message click "Edit in Webtask Editor"
- On the webpage, replace the generated code with the code in dist/webtask.js and hit save
- Click the wrench icon -> secrets, and add you Google Translate API key as API_KEY
You can now translate text in slack! Use the following format:
/wt [translate-command] [target-language] [any text you want]
Example:
/wt translate fr This is some sample text.
To see a list of available languages:
/wt [translate-command] lang
Copy .env.example to .env, and populate API_KEY
npm run create
npm run deploy
npm test
All Tests, Including Integration Tests against the Google Translate API
npm test:all