【文件属性】:
文件名称:translation-google:Nodejs的Google Translate组件
文件大小:7KB
文件格式:ZIP
更新时间:2021-02-03 12:19:32
language google free translate china
翻译-Google
Google Translate API:警告:当您使用这种方法进行翻译时,Google Translate存在IP禁止风险。
产品特点
翻译Google翻译支持的所有语言。
支持不同地区(支持中国用户,在*可以将后缀设置为'cn'以使其起作用)
使用Node.js进行现场演示
安装
npm install translation-google
用法
从自动语言检测到英语:
var translate = require ( 'translation-google' ) ;
translate ( 'This is Google Translate' , { to : 'zh-cn' } ) . then ( res => {
console . log ( res . text ) ;
//=> 这是Google翻译
console . log ( res . from . language . iso ) ;
//=> en
} ) . catch ( err => {
console . error ( er
【文件预览】:
translation-google-master
----test.js(4KB)
----.travis.yml(87B)
----LICENSE(1KB)
----README.md(4KB)
----.gitignore(584B)
----index.js(5KB)
----package.json(1KB)