swc-plugin 翻译-导入器
一个简单的插件,用从文件导入来取代翻译密钥用法.
使用量
在这些例子中,包含当时翻译的 JSON 文件
进口被认为是 @tools/i18n-plugin/.cache/translations.i18n。 。 。 .
对于Next.js,您可以安装软件包并直接从
next.config.js
module.exports = {
experimental: {
swcPlugins: [
[
"@galaxus/swc-plugin-translation-importer",
{ translationCache: "@tools/i18n-plugin/.cache/translations.i18n" },
],
],
},
};
如果您使用 SWC 单独操作, 您必须通过添加
类似以下的东西 .swcrc
{
"jsc": {
"experimental": {
"plugins": [
[
"/path/to/swc_plugin_translation_importer.wasm",
{
"translationCache": "@tools/i18n-plugin/.cache/translations.i18n"
}
]
]
}
}
}
构建
拿着 Rust工具链 编辑
右侧目标 rustup target add wasm32-wasip1那你只是个 npm run build 离开,可以找到结果 swc_plugin_translation_importer.wasm。 。 。 .
释放
要得到必要的工具,运行 npm install 如果在安装前从未完成( s)
git-cliff (英语)。 。 。 .
在发布公关
- 生成更改日志
git cliff --bump -o CHANGELOG.md更新 版本编号在Cargo.toml财务报告和审定财务报表package.json
打开 main (在发布 PR 合并后) do
git tag vX.Y.Z财务报告和审定财务报表git push --tagsnpm publish
许可证
根据其中任何一项颁发的许可证
随便你.
捐款
除非您另有明确声明,否则有意提交的任何捐款 根据Apache-2.0许可证的定义,由您列入工作 (a) 具有上述双重许可证,不附加任何条件.