2.0.2 • Published 4 months ago

@mango-scripts/i18n-scripts v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

安装

pnpm add @mango-scripts/i18n-scripts -D

注意:这是一个 纯ESM包

使用

在项目 package.jsonscripts 增加脚本命令

updateLocale

从国际化文案配置系统下载语言包文件并进行对比和梳理

{
  "scripts": {
    "updateLocale": "i18n-scripts updateLocale --address <url> --output <dirPath> --localeList <locale...>"
  }
}
Options:
  -a, --address <url>           国际化文案配置系统接口地址
  -o, --output <dirPath>        语言包的存放目录路径
  -l, --localeList [locale...]  需要下载的语言包列表

例如:

{
  "scripts": {
    "updateLocale": "i18n-scripts updateLocale --address http://xxx:5003/api/locale/get_locale_map --output ./src/locales/common/ --localeList zh-CN en-US id-ID"
  }
}

insertI18n

vue 文件添加 $t('xxx') 国际化 i18n 标识

{
  "scripts": {
    "insertI18n": "i18n-scripts insertI18n --input <dirPath> --output <dirPath> --localeModulesStr <string>"
  }
}
Options:
  -i, --input <dirPath>            输入目录路径
  -o, --output <dirPath>           输出目录路径
  -l, --localeModulesStr <string>  国际化文案模块字段

例如:

{
  "scripts": {
    "insertI18n": "i18n-scripts insertI18n --input ./src/source -output ./src/target -localeModulesStr 需求1"
  }
}

License

MIT

2.0.2

4 months ago

2.0.1

5 months ago

2.0.0

7 months ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago