1.0.6 • Published 8 years ago
google-translate-post-api v1.0.6
google-translate-post-api
google translate post api
Features
google-translate-api can't translate too long article, because of use GET
request, i just change to POST
way and add domain name setting for china.
Install
npm install --save google-translate-post-api
Usage
use cncom
parameter to switch request if you are blocked by gfw.
const translate = require('google-translate-post-api');
translate('你好', {from: 'zh-cn', to: 'en', cncom: 'cn', raw: true}).then(res => {
console.log(res.text);
//=> hello
console.log(res.from.language.iso);
//=> zh-cn
}).catch(err => {
console.error(err);
});
More detail
you can see google-translate-api
License
MIT