1.1.7 • Published 2 years ago
add-i18n-t v1.1.7
安装
npm install add-i18n-t -g
快速开始
为 react
项目指定目录及子目录下的 tsx|jsx 文件中汉字添加翻译 t
$ ait add /tmp/examples/src
默认遍历 tsx|jsx 文件 如果需要遍历 js|ts 文件
$ ait add /tmp/examples/src -ext=js,ts
可以在遍历文件的首行增加代码
$ ait add /tmp/examples/src -adc="import { t } from 'utils/i18n'"
收集指定目录及子目录下 t 函数所包裹的字符 经谷歌翻译最终生成 json 文件
$ ait translate /tmp/examples/src