Baidu-domain translator with OpenTranslate API.
Yarn
yarn add @opentranslate/baidu-domain
NPM
npm i @opentranslate/baidu-domain
import BaiduDomain from '@opentranslate/baidu-domain'
//please refer to https://api.fanyi.baidu.com/doc/22 for more details
const baiduDomain = new BaiduDomain({
config: {
domain: "medicine", // select from ["medicine", "electronics", "mechanics"]
key: process.env.KEY as string,
appid: process.env.APPID as string
}
});
baiduDomain.translate("肌萎缩侧索硬化症","zh-CN","en").then(console.log)
See translator for more details.
The material and source code from this package are for study and research purposes only. Any reliance you place on such material or source code are strictly at your own risk.