rsbuild-auto-i18n-plugin 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/readme-en.md +11 -0
- package/readme.md +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsbuild-auto-i18n-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Rsbuild automatic translation plugin compatible with Rspack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@babel/core": "^7.23.2",
|
|
35
35
|
"@babel/preset-env": "^7.23.2",
|
|
36
36
|
"@babel/preset-typescript": "^7.23.2",
|
|
37
|
-
"auto-i18n-plugin-core": "1.1.
|
|
37
|
+
"auto-i18n-plugin-core": "1.1.14"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@babel/types": "^7.23.0",
|
package/readme-en.md
CHANGED
|
@@ -386,6 +386,7 @@ import '../lang/index.js' // 📍 Must be imported on the first line of the entr
|
|
|
386
386
|
| insertFileExtensions | string[] | ❌ | `[]` | List of file extensions to insert translation code into |
|
|
387
387
|
| isClear | boolean | ❌ | `false` | Whether to clear content not in context (clear source language key-value pairs not in context), only supported in build mode |
|
|
388
388
|
| isClearSpace | boolean | ❌ | `false` | Whether to remove whitespace from both ends of source strings, whitespace is preserved by default |
|
|
389
|
+
| languageJsonMode | string | ❌ | `'merged'` | Language JSON storage mode: `'merged'` (all languages in one index.json) or `'split'` (separate json file for each language) |
|
|
389
390
|
|
|
390
391
|
---
|
|
391
392
|
|
|
@@ -474,6 +475,12 @@ To update translations, simply modify `index.json`.
|
|
|
474
475
|
- `index.json` in `globalPath` is the core translation file
|
|
475
476
|
- Changes take effect immediately after saving
|
|
476
477
|
|
|
478
|
+
4. **JSON Storage Mode Switching** ⚠️
|
|
479
|
+
|
|
480
|
+
- When switching `languageJsonMode` config (`merged` ↔ `split`), it's **strongly recommended** to set `rewriteConfig` to `true`.
|
|
481
|
+
- This ensures the plugin regenerates config files and avoids errors caused by conflicts between old and new mode files.
|
|
482
|
+
- After switching modes, the plugin will automatically handle JSON file merging or splitting.
|
|
483
|
+
|
|
477
484
|
---
|
|
478
485
|
|
|
479
486
|
## 📦 User Group
|
|
@@ -508,6 +515,10 @@ Original authors: wenps, xu-code, Caleb-Xu, Winfans
|
|
|
508
515
|
|
|
509
516
|
## Changelog
|
|
510
517
|
|
|
518
|
+
### v1.1.13 (Recommended Version)
|
|
519
|
+
|
|
520
|
+
- Added JSON split configuration
|
|
521
|
+
|
|
511
522
|
### v1.1.12 (Recommended Version)
|
|
512
523
|
|
|
513
524
|
- Optimized console output format
|
package/readme.md
CHANGED
|
@@ -389,6 +389,7 @@ import '../lang/index.js' // 📍 必须在入口文件中第一行引入,文
|
|
|
389
389
|
| insertFileExtensions | string[] | ❌ | `[]` | 要插入翻译代码的文件扩展名列表 |
|
|
390
390
|
| isClear | boolean | ❌ | `false` | 是否清除已经不在上下文中的内容(清除项目中不再使用到的源语言键值对),仅仅支持打包模式下使用 |
|
|
391
391
|
| isClearSpace | boolean | ❌ | `false` | 是否清除源字符串中左右两边的空格,默认会保留空格 |
|
|
392
|
+
| languageJsonMode | string | ❌ | `'merged'` | 语言JSON存储模式:`'merged'`(所有语言合并到一个index.json)或 `'split'`(每种语言单独一个json文件) |
|
|
392
393
|
|
|
393
394
|
---
|
|
394
395
|
|
|
@@ -479,6 +480,12 @@ const HelloWorld: React.FC<HelloWorldProps> = ({ name = 'World' }) => {
|
|
|
479
480
|
- `globalPath` 目录中的 `index.json` 是核心翻译文件。
|
|
480
481
|
- 修改并保存后,您的翻译内容将立即更新。
|
|
481
482
|
|
|
483
|
+
4. **JSON 存储模式切换** ⚠️
|
|
484
|
+
|
|
485
|
+
- 当切换 `languageJsonMode` 配置(`merged` ↔ `split`)时,**强烈建议**将 `rewriteConfig` 设置为 `true`。
|
|
486
|
+
- 这样可以确保插件重新生成配置文件,避免新旧模式文件冲突导致的错误。
|
|
487
|
+
- 切换模式后,插件会自动处理 JSON 文件的合并或拆分。
|
|
488
|
+
|
|
482
489
|
---
|
|
483
490
|
|
|
484
491
|
## 📦 用户群
|
|
@@ -513,6 +520,10 @@ const HelloWorld: React.FC<HelloWorldProps> = ({ name = 'World' }) => {
|
|
|
513
520
|
|
|
514
521
|
## 更新日志
|
|
515
522
|
|
|
523
|
+
### v1.1.13 (推荐版本)
|
|
524
|
+
|
|
525
|
+
- 新增json拆分配置
|
|
526
|
+
|
|
516
527
|
### v1.1.12 (推荐版本)
|
|
517
528
|
|
|
518
529
|
- 优化控制台输出格式
|