@carlhong/translate

translate Chinese to other language file

Usage no npm install needed!

<script type="module">
  import carlhongTranslate from 'https://cdn.skypack.dev/@carlhong/translate';
</script>

README

@carlhong/translate

npm (scoped)

translate Chinese to other language file.

Install

$ npm install @carlhong/translate

Usage

//this is the default options
const defaultOptions = {
    engine: 'google', //youdao, baidu, google
    from: 'zh-CN',
    to: 'en',
    encoding: 'utf8',
    srcFile: '',
    distFile: ''
};

const translate = require('@carlhong/translate');
translate({
    srcFile: 'zh_cn.json',
    distFile: 'en.json'
})