1.0.2 • Published 12 months ago

@jswork/next-baidu-fanyi v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
12 months ago

next-baidu-fanyi

Baidu fangyi api wrapper.

version license size download

installation

npm install -S @jswork/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 '@jswork/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

license

Code released under the MIT license.