1.2.2 • Published 4 years ago

@feizheng/next-baidu-fanyi v1.2.2

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

next-baidu-fanyi

Baidu fangyi api wrapper.

installation

npm install -S @feizheng/next-baidu-fanyi

apis

apiparamsdescription
translate-Get translation

options

namedefaultdescription
delay1000Call fn duration.
fromzhfrom which language
toento which language
appid--
secret--
q-keywords

usage

import NxBaiduFanyi from '@feizheng/next-baidu-fanyi';

// code goes here:
NxBaiduFanyi.translate({ q: '苹果', from:'zh', to:'en' }).then((res) => {
  /*
  // res:
  {
    from: 'zh',
    to: 'en',
    trans_result: [{ src: '苹果', dst: 'Apple' }]
  }
  */
});

resources