A free and unlimited API for Google Translate ๐ต๐ซ
- Auto language detection
- Spelling correction
- Language correction
npm install gtranslate-api
or
yarn add gtranslate-api
for automatic detection language:
const trans = require('google-translate-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: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})
trans.getDictionary('Aku orang indonesia!', {from: 'id', to: 'en'}).then(res => {
console.log(res.translation);
//=> I am Indonesian
})
getSentence(text, options)
getDictionary(text, options)
MIT ยฉ Abdul Muttaqin