gtranslate-api
v1.0.4
Published
Free And Unlimited Google Translate API
Downloads
5
Maintainers
Readme
A free and unlimited API for Google Translate :dollar::no_entry_sign:
Features
- Auto language detection
- Spelling correction
- Language correction
Install
npm install gtranslate-api
or
yarn install gtranslate-api
Usage
for automatic detection language:
const trans = require('gtranslate-api');
trans.getSentence('Aku orang indonesia', {to: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})
for specific language:
trans.getSentence('Aku orang indonesia!', {from: 'id', to: 'end'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})
it's also can get dictionary from translation
trans.getDictionary('Aku orang indonesia!', {from: 'id', to: 'end'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})
API
getSentence(text, options)
getDictionary(text, options)
License
MIT © Abdul Muttaqin