0.0.13 • Published 8 months ago
@ng1005/chrome-extension-i18n v0.0.13
chrome扩展多语言包生成脚本
安装
npm install @ng1005/package-i18n --registry=http://localhost:4873/
pnpm install @ng1005/package-i18n --registry=http://localhost:4873/
yarn add @ng1005/package-i18n --registry=http://localhost:4873/使用
import { genChrome,getPath,genElementLangOption,genNormal,translateObjectLang,
writeJson,writeText,isFileExisted,readJson,readText,genElementLangs, } from "@ng1005/package-i18n";
#假设在插件目录下src/langs/目录下执行,改目录下有index.ts用来定义语言包,当前支持对象
import {lang} from './index.ts'
let langs=['zh_CN','en']//为空或者不传时生成所有
genChrome(lang,getPath('../../public/_locales/'),langs)