gtranslate-api

1.0.4 • Public • Published

A free and unlimited API for Google Translate 💵🚫

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

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i gtranslate-api

    Weekly Downloads

    13

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    8.14 kB

    Total Files

    6

    Last publish

    Collaborators

    • fdcicyber