https://github.com/waithawoo/node-googleapi-translate
To translate languages with Google Translation API V2
https://github.com/waithawoo/node-googleapi-translate
google google-translate google-translate-api google-translator translate translate-api
Last synced: 6 days ago
JSON representation
To translate languages with Google Translation API V2
- Host: GitHub
- URL: https://github.com/waithawoo/node-googleapi-translate
- Owner: waithawoo
- License: mit
- Created: 2023-06-14T16:48:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-17T07:29:59.000Z (about 3 years ago)
- Last Synced: 2026-02-11T19:57:29.484Z (4 months ago)
- Topics: google, google-translate, google-translate-api, google-translator, translate, translate-api
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node Google API Translation
## To translate languages with Google Translation API V2
- **[Installation](#installation)**
- **[Usage](#usage)**
## Installation
Install this package via [npm](https://npmjs.com/).
```
npm install googleapi-translate
```
## Usage
- import the package and create a new object by passing token
```
let googleApi = require("googleapi-translate")
let googleTranslation = new googleApi({token: 'this is token'})
```
- default hostname is ''translation.googleapis.com'' and you can also pass hostname like this :
```
let googleTranslation = new googleApi({token: 'this is token', hostname: 'this is hostname'})
```
### Translate
```
googleTranslation.translate("hello", "en", "ja").then((res)=>{
console.log(res);
})
```
### Detect the language
```
googleTranslation.detect("hello").then((res)=>{
console.log(res);
})
```
### Get supported languages
```
googleTranslation.getLanguages().then((res)=>{
console.log(res);
})
```
## Security
If you discover any security related issues, please email them to [waithawoocw@gmail.com](mailto:waithawoocw@gmail.com) instead of using the issue tracker.
## License
The MIT License (MIT). Please see the [License File](LICENSE) for more information.