https://github.com/bitliner/google-translate-api-nodejs-client
Just a client for Google Translate API
https://github.com/bitliner/google-translate-api-nodejs-client
Last synced: about 1 year ago
JSON representation
Just a client for Google Translate API
- Host: GitHub
- URL: https://github.com/bitliner/google-translate-api-nodejs-client
- Owner: bitliner
- Created: 2015-03-23T20:07:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-01-04T14:36:57.000Z (over 8 years ago)
- Last Synced: 2025-04-22T17:23:00.645Z (about 1 year ago)
- Language: JavaScript
- Size: 1010 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# google-translate-api-nodejs-client
Just a client for Google Translate API
Compatible with NodeJS 6 (and with Google Cloud functions)
## Usage
```
var GoogleTranslateApi=require('google-translate-api-nodejs-client');
new GoogleTranslateApi({
API_KEY:'...'
})
.translate({
source:'en',
target:'ge',
text:'...text is here...'
}, function(err,translation){
// translation is a string representing the output translation
// original response would be in html, this client converts the html to a proper text string
});
```
## Check available language
```
cd google-translate-api-nodejs-client
GOOGLE_TRANSLATE_API_KEY=... node availableLanguages.js
```
## TODO
- [X] support async/await style
- [X] validate input languages (according to [List of supported languages](https://cloud.google.com/translate/docs/languages)) - extractable from API
- [ ] add language detection in case 'from' language is not specified