1.0.4 • Published 2 years ago

gtranslate-api v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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