Skip to content

Commit cbe880e

Browse files
committed
🌐 处理翻译问题
1 parent 017b608 commit cbe880e

7 files changed

Lines changed: 32 additions & 6 deletions

File tree

docs/AI prompt.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
### 输入格式
2626
请严格按此格式提供被测试代码,下面请为此文件编写单元测试
2727

28+
```
29+
30+
## 提取翻译
31+
32+
```md
33+
34+
你是一个翻译专家,使用react-i18next做为翻译框架,我需要你帮助我翻译这个React文件中的中文,首先你需要提取文件中的中文部分,生成一个合适的key,使用蛇形命名,添加到 src/locales/zh-CN/translations.json 文件中,然后使用`useTranslation`替换原有中文,如果有参数你可以使用i18next的格式,不需要处理其他语言,不要做多余的事情
35+
2836
```

src/locales/ach-UG/translation.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@
217217
"run_once": "crwdns8308:0crwdne8308:0",
218218
"stop": "crwdns8310:0crwdne8310:0",
219219
"edit": "crwdns8312:0crwdne8312:0",
220+
"exclude_on": "crwdns8922:0crwdne8922:0",
221+
"exclude_off": "crwdns8924:0crwdne8924:0",
220222
"user_config": "crwdns8320:0crwdne8320:0",
221223
"gm_api": "crwdns8322:0crwdne8322:0",
222224
"storage_api": "crwdns8324:0crwdne8324:0",
@@ -445,5 +447,9 @@
445447
"blacklist_pages_desc": "crwdns8908:0crwdne8908:0",
446448
"development_tools": "crwdns8910:0crwdne8910:0",
447449
"check_script_code_quality": "crwdns8912:0crwdne8912:0",
448-
"custom_eslint_rules_config": "crwdns8914:0crwdne8914:0"
450+
"custom_eslint_rules_config": "crwdns8914:0crwdne8914:0",
451+
"light": "crwdns10794:0crwdne10794:0",
452+
"dark": "crwdns10796:0crwdne10796:0",
453+
"individual_edit": "crwdns10798:0crwdne10798:0",
454+
"batch_edit": "crwdns10800:0crwdne10800:0"
449455
}

src/locales/en-US/translation.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,5 +447,9 @@
447447
"blacklist_pages_desc": "Prevent scripts from running on specified pages, supports wildcards",
448448
"development_tools": "Development Tools",
449449
"check_script_code_quality": "Check script code quality and errors",
450-
"custom_eslint_rules_config": "Custom ESLint rules configuration (JSON format)"
450+
"custom_eslint_rules_config": "Custom ESLint rules configuration (JSON format)",
451+
"light": "Light",
452+
"dark": "Dark",
453+
"individual_edit": "Individual Edit",
454+
"batch_edit": "Batch Edit"
451455
}

src/locales/ja-JP/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,5 +447,7 @@
447447
"blacklist_pages_desc": "指定されたページでスクリプトの実行を禁止、ワイルドカードをサポート",
448448
"development_tools": "開発ツール",
449449
"check_script_code_quality": "スクリプトコードの品質とエラーをチェック",
450-
"custom_eslint_rules_config": "カスタムESLintルール設定(JSON形式)"
450+
"custom_eslint_rules_config": "カスタムESLintルール設定(JSON形式)",
451+
"individual_edit": "個別編集",
452+
"batch_edit": "一括編集"
451453
}

src/locales/zh-CN/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,5 +449,7 @@
449449
"check_script_code_quality": "检查脚本代码质量和错误",
450450
"custom_eslint_rules_config": "自定义 ESLint 规则配置(JSON 格式)",
451451
"light": "亮色模式",
452-
"dark": "暗色模式"
452+
"dark": "暗色模式",
453+
"individual_edit": "单独编辑",
454+
"batch_edit": "批量编辑"
453455
}

src/locales/zh-TW/translation.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,5 +447,9 @@
447447
"blacklist_pages_desc": "禁止腳本在指定頁面執行,支援萬用字元",
448448
"development_tools": "開發工具",
449449
"check_script_code_quality": "檢查腳本程式碼品質和錯誤",
450-
"custom_eslint_rules_config": "自訂 ESLint 規則設定(JSON 格式)"
450+
"custom_eslint_rules_config": "自訂 ESLint 規則設定(JSON 格式)",
451+
"light": "淺色模式",
452+
"dark": "暗色模式",
453+
"individual_edit": "单独编辑",
454+
"batch_edit": "批量編輯"
451455
}

src/pages/components/ScriptStorage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ const ScriptStorage: React.FC<{
305305
setIsEdit(!isEdit);
306306
}}
307307
>
308-
{isEdit ? "单独编辑" : "批量编辑"}
308+
{isEdit ? t("individual_edit") : t("batch_edit")}
309309
</Button>
310310
</Space>
311311
{isEdit ? (

0 commit comments

Comments
 (0)