Skip to content

feat: 添加多语言支持的文本和提示信息,增强用户体验#88

Merged
Bowl42 merged 1 commit intoawsl-project:mainfrom
whhjdi:fix/i18n
Jan 16, 2026
Merged

feat: 添加多语言支持的文本和提示信息,增强用户体验#88
Bowl42 merged 1 commit intoawsl-project:mainfrom
whhjdi:fix/i18n

Conversation

@whhjdi
Copy link
Contributor

@whhjdi whhjdi commented Jan 16, 2026

Summary by CodeRabbit

发布说明

  • 多语言支持
    • 扩展了中英文翻译库,新增了常用操作的标签(复制、保存、删除、更新等)
    • 优化了翻译架构,提升了多语言界面的一致性和完整性

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

概览

该PR重组了英文和中文本地化文件中的翻译字符串,在通用(common)部分添加了12个新的翻译键(如copy、copied、saving等),同时从两个文件中删除或重新组织了routes、requests、sessions等大型顶级部分的内容。

变更

群组 / 文件 变更摘要
本地化文件重组
web/src/locales/en.json, web/src/locales/zh.json
在common部分添加12个新键(copy、copied、saving、saved、clientType、default、deleting、updating、day、days、global、initFailed);删除或重新调整routes、requests、sessions、routingStrategies、projects等顶级翻译部分;重组requests相关文本,包括请求ID、标签、元数据等;扩展routes和projects部分的嵌套结构

代码审查工作量估算

🎯 2 (Simple) | ⏱️ ~12 分钟

可能相关的PR

建议审查者

  • awsl233777

诗歌

🐰 翻译字符串整齐排,
common中添新彩,
删旧部分理清晰,
国际化更整洁,
兔兔🐇献一礼!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题清晰准确地总结了主要变更——添加多语言支持的文本和提示信息,这与en.json和zh.json文件中新增common、routes、requests等多个翻译键值完全对应。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@web/src/locales/en.json`:
- Around line 114-125: The keys requestId and attemptId use JS-template style
"${id}" which i18next won't interpolate; update their values to use i18next
interpolation "{{id}}" so translations render correctly (change the string for
"requestId" from "Request #${id}" to "Request #{{id}}" and for "attemptId" from
"Attempt #${id}" to "Attempt #{{id}}").

In `@web/src/locales/zh.json`:
- Around line 125-126: The Chinese locale value for the key "compareBody" uses a
likely typo "上流"; update the translation string to use "上游" to match
"compareHeaders" and consistent wording—i.e., change the value of "compareBody"
from "比较正文 - 客户端 vs 上流" to "比较正文 - 客户端 vs 上游".
- Around line 114-125: Update the i18n placeholders and the upstream
translation: replace the template placeholders in the "requestId" and
"attemptId" entries (currently using "${id}") with i18next-compatible "{{id}}",
and ensure the "compareHeaders" value uses the correct Chinese word "上游" (not
"上流") so it matches the other entries.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed8d8d and ffdfde8.

📒 Files selected for processing (2)
  • web/src/locales/en.json
  • web/src/locales/zh.json

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +114 to +125
"requestId": "Request #${id}",
"noRequestData": "No request data available",
"noResponseData": "No response data available",
"noAttempts": "No attempts available",
"tabs": {
"request": "Request",
"response": "Response",
"metadata": "Metadata"
},
"selectAttempt": "Select an attempt to view details",
"attemptId": "Attempt #${id}",
"compareHeaders": "Compare Headers - Client vs Upstream",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cd web && wc -l src/locales/en.json

Repository: awsl-project/maxx

Length of output: 84


🏁 Script executed:

cd web && sed -n '114,125p' src/locales/en.json

Repository: awsl-project/maxx

Length of output: 503


🏁 Script executed:

cd web && rg '\{\{.*?\}\}|\$\{.*?\}' src/locales/en.json -o | head -30

Repository: awsl-project/maxx

Length of output: 278


🏁 Script executed:

cd web && cat package.json | grep -A 5 '"i18n\|vue-i18n\|translations'

Repository: awsl-project/maxx

Length of output: 227


🏁 Script executed:

cd web && head -150 src/locales/en.json | tail -50

Repository: awsl-project/maxx

Length of output: 1882


插值格式不一致且与 i18next 不兼容

requestIdattemptId 使用了 ${id} 格式,但项目使用 i18next(^25.7.4),其标准插值语法为 {{variable}}。当前格式会原样显示,而不会被实际值替换。文件中其他插值全部使用正确的 {{}} 格式。

需要将这两处更改为 {{id}}

修复方案
-    "requestId": "Request #${id}",
+    "requestId": "Request #{{id}}",
...
-    "attemptId": "Attempt #${id}",
+    "attemptId": "Attempt #{{id}}",
🤖 Prompt for AI Agents
In `@web/src/locales/en.json` around lines 114 - 125, The keys requestId and
attemptId use JS-template style "${id}" which i18next won't interpolate; update
their values to use i18next interpolation "{{id}}" so translations render
correctly (change the string for "requestId" from "Request #${id}" to "Request
#{{id}}" and for "attemptId" from "Attempt #${id}" to "Attempt #{{id}}").

Comment on lines +114 to +125
"requestId": "请求 #${id}",
"noRequestData": "无请求数据",
"noResponseData": "无响应数据",
"noAttempts": "无可用尝试",
"tabs": {
"request": "请求",
"response": "响应",
"metadata": "元数据"
},
"selectAttempt": "选择一个尝试以查看详情",
"attemptId": "尝试 #${id}",
"compareHeaders": "比较标头 - 客户端 vs 上游",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the zh.json file
find . -path "*/locales/zh.json" -type f

Repository: awsl-project/maxx

Length of output: 86


🏁 Script executed:

# Also search for related locale files to understand the structure
find . -path "*/locales/*" -type f | head -20

Repository: awsl-project/maxx

Length of output: 112


🏁 Script executed:

# Check if there's a configuration or package.json that indicates the i18n library
find . -name "package.json" -o -name "*.config.js" -o -name "i18n*" | grep -E "(package\.json|i18n)" | head -10

Repository: awsl-project/maxx

Length of output: 136


🏁 Script executed:

# Read the zh.json file to check interpolation patterns
cat -n ./web/src/locales/zh.json | head -150

Repository: awsl-project/maxx

Length of output: 4733


🏁 Script executed:

# Check the i18n.ts file to understand the interpolation format
cat -n ./web/src/lib/i18n.ts

Repository: awsl-project/maxx

Length of output: 1398


🏁 Script executed:

# Check package.json for i18n library dependencies
cat -n ./web/package.json

Repository: awsl-project/maxx

Length of output: 2320


修复占位符格式和翻译错误

在 i18next(默认配置使用 {{}} 语法)中,第 114 和 124 行使用的 ${id} 格式将无法被替换,会导致页面显示 请求 #${id} 的字面值。应改为 {{id}}

同时,第 126 行的"上流"是错误的;与第 125 行保持一致,应使用"上游"。

修复内容
-    "requestId": "请求 #${id}",
+    "requestId": "请求 #{{id}}",
-    "attemptId": "尝试 #${id}",
+    "attemptId": "尝试 #{{id}}",
-    "compareBody": "比较正文 - 客户端 vs 上流",
+    "compareBody": "比较正文 - 客户端 vs 上游",
🤖 Prompt for AI Agents
In `@web/src/locales/zh.json` around lines 114 - 125, Update the i18n placeholders
and the upstream translation: replace the template placeholders in the
"requestId" and "attemptId" entries (currently using "${id}") with
i18next-compatible "{{id}}", and ensure the "compareHeaders" value uses the
correct Chinese word "上游" (not "上流") so it matches the other entries.

Comment on lines +125 to +126
"compareHeaders": "比较标头 - 客户端 vs 上游",
"compareBody": "比较正文 - 客户端 vs 上流",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

“上流”疑似笔误

“客户端 vs 上流”更常见表述为“客户端 vs 上游”。

✏️ 建议修复
-    "compareBody": "比较正文 - 客户端 vs 上流",
+    "compareBody": "比较正文 - 客户端 vs 上游",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"compareHeaders": "比较标头 - 客户端 vs 上游",
"compareBody": "比较正文 - 客户端 vs 上流",
"compareHeaders": "比较标头 - 客户端 vs 上游",
"compareBody": "比较正文 - 客户端 vs 上游",
🤖 Prompt for AI Agents
In `@web/src/locales/zh.json` around lines 125 - 126, The Chinese locale value for
the key "compareBody" uses a likely typo "上流"; update the translation string to
use "上游" to match "compareHeaders" and consistent wording—i.e., change the value
of "compareBody" from "比较正文 - 客户端 vs 上流" to "比较正文 - 客户端 vs 上游".

@Bowl42 Bowl42 merged commit 55fee37 into awsl-project:main Jan 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants