🔧 build: 使用 yaml i18n

This commit is contained in:
frostime 2024-04-05 22:41:07 +08:00
parent 6700d611b9
commit 91deda2a72
8 changed files with 108 additions and 25 deletions

View file

@ -62,9 +62,12 @@
* 插件自身的元信息,比如插件描述和自述文件
* plugin.json 中的 `description` 和 `readme` 字段,以及对应的 README*.md 文件
* 插件中使用的文本,比如按钮文字和提示信息
* src/i18n/*.json 语言配置文件
* public/i18n/*.json 语言配置文件
* 代码中使用 `this.i18.key` 获取文本
* 最后在 plugin.json 中的 `i18n` 字段中声明该插件支持的语言
* yaml 支持
* 本模板特别支持基于 Yaml 语法的 I18n`public/i18n/zh_CN.yaml`
* 编译时,会自动把定义的 yaml 文件翻译成 json 文件放到 dist 或 dev 目录下
建议插件至少支持英文和简体中文,这样可以方便更多人使用。