feat(i18n): add missing translations and fix Semi Design locale mapping#2958
feat(i18n): add missing translations and fix Semi Design locale mapping#29580-don wants to merge 1 commit intoQuantumNous:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds extensive translation entries to five locale JSON files (fr, ja, ru, vi, zh-TW), removes three entries from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.
In `@web/src/i18n/locales/fr.json`:
- Around line 2733-2831: The file contains a wrong value and non-Chinese keys:
replace the hash value for the key "设计版本" with the intended French label (so the
UI shows the localized label, not a hash), and remove or rename English keys
("Recharge Quota", "Cache Directory", "Available", "GC execution failed") back
to their original Chinese source-string keys mapping to the same French
translations; ensure the JSON uses only Chinese source strings as keys (e.g.,
restore the Chinese keys that correspond to those English entries) so lookups
follow the project convention.
In `@web/src/i18n/locales/ja.json`:
- Line 2718: Replace the newly added English keys in ja.json ("Recharge Quota",
"GC execution failed", "Cache Directory", "Available") with their Chinese
source-key equivalents from the zh locale (use the exact Chinese strings used in
web/src/i18n/locales/zh.json for those entries) and remove the English-key
duplicates so the Japanese file continues to use Chinese source keys for
lookups; update the corresponding translations as needed under the Chinese keys
to preserve the Japanese values.
In `@web/src/i18n/locales/ru.json`:
- Line 2747: Replace the newly added English i18n keys with the
Chinese-source-key equivalents from the zh locale to follow the project
convention: locate the entries with keys "Recharge Quota", "GC execution
failed", "Cache Directory", and "Available" (also the duplicate English keys
around lines referenced in the comment) in the ru.json diff and swap each
English key for the corresponding Chinese source string used in
web/src/i18n/locales/zh.json, then remove the English-duplicated keys so lookups
use the Chinese-source-key convention consistently.
In `@web/src/i18n/locales/vi.json`:
- Around line 3343-3348: Remove the duplicate English-keyed translation entries
"GC execution failed", "Cache Directory", and "Available" from the vi.json file;
keep the Chinese-keyed entries "GC 执行失败", "缓存目录", and "可用" as the single
source-of-truth, and ensure the resulting JSON remains valid (no trailing
commas) after deleting those three keys.
In `@web/src/i18n/locales/zh-TW.json`:
- Around line 2791-2818: The zh-TW locale contains English keys (e.g., "Recharge
Quota", "Cache Directory", "Available", "GC execution failed") which breaks the
Chinese-source-key convention; update the locale so keys remain the original
Chinese source strings used by the app (replace the English keys with their
Chinese source keys or re-run the i18n extraction tool), keeping the existing
Traditional Chinese translations as values; verify entries like "Recharge Quota"
-> use the Chinese source key for that string, and likewise for "Cache
Directory", "Available", "GC execution failed" and any other non-Chinese keys in
the zh-TW JSON.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed. In `@web/src/i18n/locales/vi.json`: - Around line 3343-3348: Remove the duplicate English-keyed translation entries "GC execution failed", "Cache Directory", and "Available" from the vi.json file; keep the Chinese-keyed entries "GC 执行失败", "缓存目录", and "可用" as the single source-of-truth, and ensure the resulting JSON remains valid (no trailing commas) after deleting those three keys.web/src/i18n/locales/vi.json (1)
3343-3348: Remove duplicate English-keyed translations that violate project i18n convention.Lines 3346–3348 contain English-keyed variants (
GC execution failed,Cache Directory,Available) mapping to identical Vietnamese translations as their Chinese-keyed counterparts on lines 3343–3345. These English keys are not referenced anywhere in the codebase and contradict the project convention of using Chinese source strings as keys. Remove the English-keyed entries to maintain consistency and reduce duplication.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/i18n/locales/vi.json` around lines 3343 - 3348, Remove the duplicate English-keyed translation entries "GC execution failed", "Cache Directory", and "Available" from the vi.json file; keep the Chinese-keyed entries "GC 执行失败", "缓存目录", and "可用" as the single source-of-truth, and ensure the resulting JSON remains valid (no trailing commas) after deleting those three keys.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/i18n/locales/vi.json`:
- Line 3341: Update the Vietnamese translation value for the JSON key "重置失败":
replace the incorrect copy-pasted value ("Đặt lại thống kê") with the correct
translation "Đặt lại thất bại" so the entry reads "重置失败": "Đặt lại thất bại".
- Around line 3294-3297: Update the untranslated English `_other` plural forms
to Vietnamese so counts ≠ 1 render correctly: replace `(筛选后显示 {{count}}
条)_other` with the Vietnamese equivalent of "(Hiển thị {{count}} mục sau khi lọ
lọc)" matching the `(筛选后显示 {{count}} 条)_one` style, replace `共 {{count}}
个模型_other` with the plural Vietnamese for "{{count}} mô hình", replace `共
{{count}} 条日志_other` with the plural Vietnamese for "{{count}} bản ghi nhật ký",
and replace `已删除 {{count}} 个令牌!_other` with the plural Vietnamese for "Đã xóa
{{count}} token!" so each `_other` key mirrors its `_one` counterpart in
Vietnamese.
---
Duplicate comments:
In `@web/src/i18n/locales/fr.json`:
- Line 2733: The JSON value for the key "设计版本" is still the placeholder hash
"b80c3466cb6feafeb3990c7820e10e50"; replace that value with the correct French
translation (e.g., "Version de conception" or the approved localization) in
fr.json, ensuring the file remains flat JSON with the Chinese source string
"设计版本" as the key and the French string as the value.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/i18n/locales/vi.json`:
- Line 3293: Replace the garbage hex value for the i18n key "设计版本" with proper
translations in the affected locale JSONs (en.json, vi.json, ru.json, ja.json,
fr.json); use the zh-TW entry "設計版本" as the source meaning ("Design Version")
and provide the correct localized strings (English: "Design Version",
Vietnamese: "Phiên bản thiết kế", Russian: "Версия дизайна", Japanese:
"設計バージョン", French: "Version de conception") for the key "设计版本" in each
respective file so the UI shows readable translations instead of the hex digest.
Add missing translation keys for all non-English languages: - zh-TW: 27 keys (plurals, cache, recharge) - fr: 98 keys (disk cache, OAuth, preferences, performance monitor) - ru: 98 keys (disk cache, OAuth, preferences, performance monitor) - ja: 103 keys (disk cache, OAuth, preferences, performance monitor) - vi: 99 keys (disk cache, OAuth, preferences, performance monitor) Fix SemiLocaleWrapper to map all supported languages (zh-TW, fr, ru, ja, vi) to their Semi Design locale counterparts instead of only zh/en, which caused UI components like pagination to show Chinese labels for non-Chinese/English users. fix(i18n): remove duplicate English-keyed translations Remove English keys (Recharge Quota, GC execution failed, Cache Directory, Available) that duplicate existing Chinese source keys, violating the project's Chinese-source-key convention for i18n lookups. fix(i18n): translate Vietnamese _other plural forms from English The _other plural variants for filtering, models, logs, and token deletion were left as English strings, causing English fallback text for count > 1 in Vietnamese locale. fix(i18n): remove duplicate English keys from en.json Remove English-keyed duplicates (GC execution failed, Cache Directory, Available) that duplicate existing Chinese-keyed entries in en.json.
c65a0ba to
f392110
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/i18n/locales/vi.json`:
- Line 3293: The "设计版本" translation value is incorrectly a hex digest instead of
a Vietnamese string — replace the value "b80c3466cb6feafeb3990c7820e10e50" for
the key "设计版本" in vi.json with the correct Vietnamese translation (e.g., a
human-readable phrase like "Phiên bản thiết kế") and ensure the same correction
is applied for the same key in en.json, ru.json, ja.json, and fr.json if they
still contain the digest; search for the exact digest string to find all
occurrences and update each file so the UI shows proper translated text instead
of the hash.
1e45c9b to
f392110
Compare
Summary
SemiLocaleWrapperto map all supported languages to their Semi Design locale counterparts (zh-TW, fr, ru, ja, vi) — previously onlyzhandenwere mapped, causing UI components like pagination to display Chinese labels ("每页条数") for non-Chinese/English usersChanges
Test plan
Summary by CodeRabbit