Add Chinese (zh) language support#2009
Conversation
- Add Chinese translation files for all 11 namespaces - Register zh language in i18n configuration - Follow existing translation structure (en, fr pattern) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
📝 WalkthroughWalkthroughAdded Simplified Chinese (zh) translations across the desktop app: 11 new locale JSON files and registration of the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🎉 Thanks for your first PR!
A maintainer will review it soon. Please make sure:
- Your branch is synced with
develop - CI checks pass
- You've followed our contribution guide
Welcome to the Auto Claude community!
| navigation: zhNavigation, | ||
| settings: zhSettings, | ||
| tasks: zhTasks, | ||
| welcome: zhWelcome, | ||
| onboarding: zhOnboarding, | ||
| dialogs: zhDialogs, | ||
| gitlab: zhGitlab, | ||
| taskReview: zhTaskReview, | ||
| terminal: zhTerminal, | ||
| errors: zhErrors | ||
| } |
There was a problem hiding this comment.
Bug: The new Chinese (zh) language is not added to the SupportedLanguage type and AVAILABLE_LANGUAGES constant, making it unavailable for selection in the UI.
Severity: HIGH
Suggested Fix
Update apps/desktop/src/shared/constants/i18n.ts. Add 'zh' to the SupportedLanguage type. Add a new object for the Chinese language to the AVAILABLE_LANGUAGES array, for example: { value: 'zh' as const, label: 'Chinese', nativeLabel: '中文' }.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: apps/desktop/src/shared/i18n/index.ts#L72-L84
Potential issue: The pull request adds Chinese (`zh`) translation resources but fails to
register the new language in `apps/desktop/src/shared/constants/i18n.ts`. Specifically,
the `SupportedLanguage` type is not updated to include `'zh'`, and the
`AVAILABLE_LANGUAGES` array is missing an entry for Chinese. As a result, the language
selector component will not render an option for Chinese, and the application's type
system will prevent the language from being set, rendering the new translations
inaccessible to users.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces Chinese (Simplified) localization by adding a comprehensive set of translation files and registering them within the i18n configuration. The review identified several critical syntax errors where unescaped double quotes within string values resulted in invalid JSON across multiple files, which would prevent the application from loading the translations. Additionally, the feedback suggests improvements for redundant translations, corrections for typos in technical terms like roadmap, and fixes for mistranslated instructions to ensure the quality and accuracy of the localized content.
| "oauth": { | ||
| "enterCode": "手动代码输入(备用)", | ||
| "enterCodeDescription": "仅在浏览器未自动重定向时才需要此对话框。如果验证已在浏览器中完成,您可以关闭此对话框。", | ||
| "fallbackNote": "仅在浏览器中看到"将此粘贴到 Claude Code"页面时使用。", |
| "addAccountsDesc": "添加并验证您的 Claude 账户以使用 AI 功能。", | ||
| "multiAccountInfo": "您可以添加多个 Claude 账户。活跃账户将用于 AI 功能。您可以随时切换账户。", | ||
| "keychainTitle": "安全存储", | ||
| "keychainDescription": "您的身份验证令牌使用系统密钥链加密存储。您可能会看到 macOS 的密码提示 - 点击"始终允许"以避免再次看到。", |
| "instructions": "验证此个人资料:", | ||
| "step1": "转到设置 > 集成", | ||
| "step2": "在 Claude 账户部分找到该个人资料", | ||
| "step3": "点击"验证"完成登录", |
| "showLessFeatures": "显示更少", | ||
| "archiveFeature": "归档", | ||
| "archiveFeatureConfirmTitle": "归档功能?", | ||
| "archiveFeatureConfirmDescription": "这将从您的路线图中移除"{{title}}"。", |
| "autoSyncDescription": "项目加载时自动获取问题", | ||
| "cli": { | ||
| "required": "需要 GitLab CLI", | ||
| "notInstalled": "GitLab CLI(glab)需要用于 OAuth 身份验证。安装它以使用"使用 OAuth"选项。", |
| "requireReviewDescription": "启用后,系统将提示您审核规格和实施计划,然后再开始编码阶段。这允许您批准、请求更改或提供反馈。", | ||
| "fastModeLabel": "快速模式", | ||
| "fastModeDescription": "相同的 Opus 4.6 模型,输出更快。每令牌成本更高。", | ||
| "fastModeNotice": "需要您的 Claude 订阅启用"额外使用"。", |
| "instructions": "重新验证:", | ||
| "step1": "转到设置", | ||
| "step2": "导航到应用设置 > 集成", | ||
| "step3": "点击您个人资料上的"重新验证"", |
| "stepReturnAndVerify": "返回此处并点击 <strong>验证验证</strong>", | ||
| "verifyAuth": "验证验证", |
| "suggestsFeatures": "建议解决竞争对手产品差距的功能", | ||
| "webSearchesTitle": "将执行网络搜索", | ||
| "webSearchesDescription": "此功能将执行网络搜索以收集竞争对手信息。您的项目名称和类型将用于搜索查询。不会共享任何代码或敏感数据。", | ||
| "optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。", |
| "aiCommitMessage": "AI 生成的提交消息", | ||
| "copied": "已复制!", | ||
| "copy": "复制", | ||
| "editHint": "根据需要编辑,然后复制并配合", |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/src/shared/i18n/locales/zh/common.json`:
- Line 595: The JSON is invalid because several values contain unescaped double
quotes; update the string values for keys "fallbackNote", "keychainDescription",
"step3", and "archiveFeatureConfirmDescription" to escape inner quotes (replace
" with \" inside those strings) so the JSON parser can parse the file, ensuring
the surrounding property quotes remain unchanged and the template "{{title}}"
remains correctly escaped as needed.
In `@apps/desktop/src/shared/i18n/locales/zh/dialogs.json`:
- Around line 1-58: The zh locale is incomplete and several files contain JSON
syntax errors; either remove "zh" from AVAILABLE_LANGUAGES or fully complete and
validate the locale to match en/fr parity (≈207 keys). Fix the missing dialog
sections (e.g., add keys like addProject, appUpdate, competitorAnalysis,
initialize, removeProject) in the dialogs.json where only keys such as "expand",
"resume", "auth", "swap", and "worktree" are present, correct JSON syntax errors
in common.json, gitlab.json, onboarding.json, settings.json, taskReview.json,
tasks.json, and terminal.json, and run a JSON linter and the repository i18n
parity check to ensure all keys match the canonical English translations before
re-adding "zh" to AVAILABLE_LANGUAGES.
In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json`:
- Around line 1-239: The Chinese locale
file/apps/desktop/src/shared/i18n/locales/zh/taskReview.json is missing the
"terminal" section used by TerminalDropdown.tsx (it calls
useTranslation('taskReview') and t('terminal.openTerminal') /
t('terminal.openInbuilt') / t('terminal.openExternal')), causing fallback to
English; add a "terminal" object with keys openTerminal, openInbuilt, and
openExternal (you can copy the corresponding translations from zh/terminal.json)
into taskReview.json near the top so the component finds the Chinese strings.
In `@apps/desktop/src/shared/i18n/locales/zh/tasks.json`:
- Line 130: The JSON contains unescaped ASCII double quotes inside string values
(e.g., the "description" entry that currently includes "进行中" with quotes), which
breaks parsing; update each affected value (lines referenced in the review) to
either escape the internal double quotes (replace " with \") or substitute them
with Chinese/fullwidth quotes (e.g., “ and ”) so the JSON string is valid, apply
the same fix for the other occurrences (the entries at the other flagged lines),
and re-run Biome/JSON lint to ensure the file parses before committing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: dd78e259-cae2-40c4-b09a-638b1f391fc1
📒 Files selected for processing (12)
apps/desktop/src/shared/i18n/index.tsapps/desktop/src/shared/i18n/locales/zh/common.jsonapps/desktop/src/shared/i18n/locales/zh/dialogs.jsonapps/desktop/src/shared/i18n/locales/zh/errors.jsonapps/desktop/src/shared/i18n/locales/zh/gitlab.jsonapps/desktop/src/shared/i18n/locales/zh/navigation.jsonapps/desktop/src/shared/i18n/locales/zh/onboarding.jsonapps/desktop/src/shared/i18n/locales/zh/settings.jsonapps/desktop/src/shared/i18n/locales/zh/taskReview.jsonapps/desktop/src/shared/i18n/locales/zh/tasks.jsonapps/desktop/src/shared/i18n/locales/zh/terminal.jsonapps/desktop/src/shared/i18n/locales/zh/welcome.json
| { | ||
| "expand": { | ||
| "expand": "展开终端", | ||
| "collapse": "折叠终端" | ||
| }, | ||
| "resume": { | ||
| "pending": "可恢复", | ||
| "pendingTooltip": "点击以恢复之前的 Claude 会话", | ||
| "resumeAllSessions": "恢复全部" | ||
| }, | ||
| "auth": { | ||
| "terminalTitle": "验证:{{profileName}}", | ||
| "maxTerminalsReached": "无法打开验证终端:已达到最大终端数。请先关闭一个终端。" | ||
| }, | ||
| "swap": { | ||
| "inProgress": "正在切换个人资料...", | ||
| "resumingSession": "正在恢复 Claude 会话...", | ||
| "sessionResumed": "会话已在新的个人资料下恢复", | ||
| "resumeFailed": "无法恢复会话。您可以开始一个新的会话。", | ||
| "noSession": "个人资料已切换。没有要恢复的活跃会话。", | ||
| "migrationFailed": "个人资料已切换,但会话迁移失败。开始新的终端。" | ||
| }, | ||
| "worktree": { | ||
| "create": "工作树", | ||
| "createNew": "新建工作树", | ||
| "existing": "终端工作树", | ||
| "taskWorktrees": "任务工作树", | ||
| "otherWorktrees": "其他", | ||
| "createTitle": "创建终端工作树", | ||
| "createDescription": "为此终端创建一个隔离的工作空间。所有工作将在工作树目录中进行。", | ||
| "name": "工作树名称", | ||
| "namePlaceholder": "my-feature", | ||
| "nameRequired": "工作树名称是必填项", | ||
| "nameInvalid": "名称必须以字母或数字开头和结尾", | ||
| "nameHelp": "小写字母、数字、连字符和下划线(空格变为连字符)", | ||
| "associateTask": "关联到任务", | ||
| "selectTask": "选择任务...", | ||
| "noTask": "无任务(独立工作树)", | ||
| "createBranch": "创建 Git 分支", | ||
| "branchHelp": "创建分支:{{branch}}", | ||
| "baseBranch": "基础分支", | ||
| "selectBaseBranch": "选择基础分支...", | ||
| "searchBranch": "搜索分支...", | ||
| "noBranchFound": "未找到分支", | ||
| "useProjectDefault": "使用项目默认值({{branch}})", | ||
| "baseBranchHelp": "创建工作树的分支", | ||
| "openInIDE": "在 IDE 中打开", | ||
| "maxReached": "已达到 12 个终端工作树的最大数量", | ||
| "alreadyExists": "此名称的工作树已存在", | ||
| "searchPlaceholder": "搜索工作树...", | ||
| "noResults": "未找到工作树", | ||
| "deleteTitle": "删除工作树?", | ||
| "deleteDescription": "这将永久删除工作树及其分支。任何未提交的更改都将丢失。", | ||
| "detached": "(分离的)", | ||
| "remotePushFailed": "远程跟踪未设置", | ||
| "remotePushFailedDescription": "工作树已创建,但无法将分支推送到远程。您可能需要手动运行 git push -u。" | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
import json
from pathlib import Path
base = Path("apps/desktop/src/shared/i18n/locales")
langs = ["en", "fr", "zh"]
def flatten(d, prefix=""):
out = set()
if isinstance(d, dict):
for k, v in d.items():
p = f"{prefix}.{k}" if prefix else k
out |= flatten(v, p)
else:
out.add(prefix)
return out
files = sorted((base / "zh").glob("*.json"))
failed = False
for zh_file in files:
ns = zh_file.name
data = {}
for lang in langs:
p = base / lang / ns
if not p.exists():
print(f"[MISSING_FILE] {lang}/{ns}")
failed = True
continue
with p.open("r", encoding="utf-8") as f:
data[lang] = flatten(json.load(f))
if len(data) < 2:
continue
ref = data.get("en") or next(iter(data.values()))
for lang, keys in data.items():
if lang == "en":
continue
miss = sorted(ref - keys)
extra = sorted(keys - ref)
if miss or extra:
failed = True
print(f"\n[DIFF] {ns} :: en vs {lang}")
if miss:
print(f" missing_in_{lang}: {len(miss)}")
for k in miss[:20]:
print(f" - {k}")
if extra:
print(f" extra_in_{lang}: {len(extra)}")
for k in extra[:20]:
print(f" + {k}")
if failed:
raise SystemExit(1)
print("Locale key parity check passed.")
PYRepository: AndyMik90/Aperant
Length of output: 804
🏁 Script executed:
#!/bin/bash
# Find which JSON file has syntax errors in the locale directory
base="apps/desktop/src/shared/i18n/locales"
for langdir in "$base"/{en,fr,zh}; do
if [ ! -d "$langdir" ]; then
echo "[MISSING] $langdir"
continue
fi
for jsonfile in "$langdir"/*.json; do
if ! python3 -m json.tool "$jsonfile" > /dev/null 2>&1; then
echo "[INVALID_JSON] $jsonfile"
python3 -m json.tool "$jsonfile" 2>&1 | head -5
fi
done
doneRepository: AndyMik90/Aperant
Length of output: 932
🏁 Script executed:
#!/bin/bash
# Verify the zh/dialogs.json file specifically
if python3 -m json.tool "apps/desktop/src/shared/i18n/locales/zh/dialogs.json" > /dev/null 2>&1; then
echo "[VALID] zh/dialogs.json is syntactically correct"
else
echo "[INVALID] zh/dialogs.json has syntax errors"
python3 -m json.tool "apps/desktop/src/shared/i18n/locales/zh/dialogs.json" 2>&1 | head -10
fiRepository: AndyMik90/Aperant
Length of output: 109
🏁 Script executed:
#!/bin/bash
# Check parity for dialogs.json specifically
python3 << 'PYEND'
import json
from pathlib import Path
base = Path("apps/desktop/src/shared/i18n/locales")
ns = "dialogs.json"
def flatten(d, prefix=""):
out = set()
if isinstance(d, dict):
for k, v in d.items():
p = f"{prefix}.{k}" if prefix else k
out |= flatten(v, p)
else:
out.add(prefix)
return out
data = {}
for lang in ["en", "fr", "zh"]:
p = base / lang / ns
if p.exists():
with p.open("r", encoding="utf-8") as f:
data[lang] = flatten(json.load(f))
print(f"✓ {lang}/{ns} loaded: {len(data[lang])} keys")
else:
print(f"✗ {lang}/{ns} NOT FOUND")
if len(data) >= 2:
print("\n=== Parity Check ===")
en_keys = data.get("en", set())
for lang in ["fr", "zh"]:
if lang in data:
missing = sorted(en_keys - data[lang])
extra = sorted(data[lang] - en_keys)
if missing or extra:
print(f"\n{lang} vs en:")
if missing:
print(f" Missing in {lang}: {missing}")
if extra:
print(f" Extra in {lang}: {extra}")
else:
print(f"\n{lang}: ✓ All keys match en")
PYENDRepository: AndyMik90/Aperant
Length of output: 7483
Do not ship zh locale support—it is incomplete and contains syntax errors across multiple files.
The zh locale cannot be deployed as-is:
zh/dialogs.jsoncontains only 46 of 207 required keys (22% complete)—missing entire dialog sections:addProject,appUpdate,competitorAnalysis,initialize,removeProject, and 10+ others- 7 additional zh locale files contain JSON syntax errors:
common.json,gitlab.json,onboarding.json,settings.json,taskReview.json,tasks.json,terminal.json
Either complete all zh translations to match en/fr parity (207 keys) and fix JSON syntax errors, or remove zh from AVAILABLE_LANGUAGES until translations are ready.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/desktop/src/shared/i18n/locales/zh/dialogs.json` around lines 1 - 58,
The zh locale is incomplete and several files contain JSON syntax errors; either
remove "zh" from AVAILABLE_LANGUAGES or fully complete and validate the locale
to match en/fr parity (≈207 keys). Fix the missing dialog sections (e.g., add
keys like addProject, appUpdate, competitorAnalysis, initialize, removeProject)
in the dialogs.json where only keys such as "expand", "resume", "auth", "swap",
and "worktree" are present, correct JSON syntax errors in common.json,
gitlab.json, onboarding.json, settings.json, taskReview.json, tasks.json, and
terminal.json, and run a JSON linter and the repository i18n parity check to
ensure all keys match the canonical English translations before re-adding "zh"
to AVAILABLE_LANGUAGES.
Fixed 4 JSON syntax errors caused by unescaped curly quotes in string values:
- oauth.fallbackNote: escaped "将此粘贴到 Claude Code"
- oauth.keychainDescription: escaped "始终允许"
- profileCreated.step3: escaped "验证"
- roadmap.archiveFeatureConfirmDescription: escaped "{{title}}"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix JSON parse errors in 6 zh locale files by replacing unescaped
ASCII double quotes inside string values with Unicode escape sequences
(\u201C / \u201D curly quotes):
- gitlab.json: "notInstalled" - \u201C使用 OAuth\u201D
- onboarding.json: "keychainDescription" - \u201C始终允许\u201D
- settings.json: "helpText" - \u201C复制调试信息\u201D (ASCII → corner brackets)
- taskReview.json: "step3" - \u201C重新验证\u201D (ASCII → corner brackets)
- tasks.json: "description", "hint", "fastModeNotice" - \u201C进行中\u201D,
\u201C额外使用\u201D
- terminal.json: "description", "worktreeExplanation" -
\u201C{{taskTitle}}\u201D, \u201C删除工作树...\u201D, \u201C仅标记完成\u201D
All zh locale files now parse as valid JSON.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pe and AVAILABLE_LANGUAGES Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/desktop/src/shared/i18n/locales/zh/taskReview.json (1)
1-13:⚠️ Potential issue | 🟠 Major
taskReviewstill missing requiredterminalsubsectionThis file still lacks
terminal.openTerminal,terminal.openInbuilt, andterminal.openExternal, so consumers oftaskReviewterminal keys will fallback or miss zh text.Based on learnings: "Before adding a new language to AVAILABLE_LANGUAGES, ensure UI translations exist and are complete ... and validated."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json` around lines 1 - 13, The taskReview locale JSON is missing the terminal subsection keys used by the UI; add a "terminal" object containing "openTerminal", "openInbuilt", and "openExternal" with appropriate Chinese translations to the existing taskReview structure so consumers don't fallback or show missing text—update the taskReview JSON entry to include terminal.openTerminal, terminal.openInbuilt, and terminal.openExternal with validated zh strings that match the tone of other entries (e.g., similar style to "initialize.title"/"description").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json`:
- Around line 206-208: The translation for the key skipAnalysis is inverted (it
currently reads "不,进行分析"); update the value for "skipAnalysis" to correctly
indicate skipping (e.g., "不,跳过分析" or similar), ensure "enableAnalysis" remains
the affirmative option ("是,启用分析"), and verify the two labels now correctly
reflect opposite choices so the UI decision button is not misleading.
---
Duplicate comments:
In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json`:
- Around line 1-13: The taskReview locale JSON is missing the terminal
subsection keys used by the UI; add a "terminal" object containing
"openTerminal", "openInbuilt", and "openExternal" with appropriate Chinese
translations to the existing taskReview structure so consumers don't fallback or
show missing text—update the taskReview JSON entry to include
terminal.openTerminal, terminal.openInbuilt, and terminal.openExternal with
validated zh strings that match the tone of other entries (e.g., similar style
to "initialize.title"/"description").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ec7f074c-19e5-4600-855b-382e70ad42f7
📒 Files selected for processing (7)
apps/desktop/src/shared/i18n/locales/zh/common.jsonapps/desktop/src/shared/i18n/locales/zh/gitlab.jsonapps/desktop/src/shared/i18n/locales/zh/onboarding.jsonapps/desktop/src/shared/i18n/locales/zh/settings.jsonapps/desktop/src/shared/i18n/locales/zh/taskReview.jsonapps/desktop/src/shared/i18n/locales/zh/tasks.jsonapps/desktop/src/shared/i18n/locales/zh/terminal.json
| "optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。", | ||
| "skipAnalysis": "不,进行分析", | ||
| "enableAnalysis": "是,启用分析", |
There was a problem hiding this comment.
skipAnalysis translation is semantically inverted
"skipAnalysis": "不,进行分析" says the opposite of the key. This will mislead users on a decision button.
Proposed fix
- "skipAnalysis": "不,进行分析",
+ "skipAnalysis": "不,跳过分析",📝 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.
| "optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。", | |
| "skipAnalysis": "不,进行分析", | |
| "enableAnalysis": "是,启用分析", | |
| "optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。", | |
| "skipAnalysis": "不,跳过分析", | |
| "enableAnalysis": "是,启用分析", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json` around lines 206 -
208, The translation for the key skipAnalysis is inverted (it currently reads
"不,进行分析"); update the value for "skipAnalysis" to correctly indicate skipping
(e.g., "不,跳过分析" or similar), ensure "enableAnalysis" remains the affirmative
option ("是,启用分析"), and verify the two labels now correctly reflect opposite
choices so the UI decision button is not misleading.
…tore correct zh translations Swap misplaced Chinese translation files: - dialogs.json: was terminal content, now has correct dialog translations - taskReview.json: was dialog content, now has correct taskReview translations - terminal.json: was taskReview content, now has correct terminal translations - Removed 2 extra plural keys (filesNeedIntelligentMerging_plural, filesNeedIntelligentMergingPlural_other) from taskReview merge section Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/desktop/src/shared/i18n/locales/zh/taskReview.json (1)
206-208:⚠️ Potential issue | 🟠 MajorFix inverted translation for
skipAnalysis.Line 207 contains
"skipAnalysis": "不,进行分析"which translates to "No, perform analysis" - this is semantically opposite to the key name. This will confuse users presented with a skip/enable decision.🛠️ Proposed fix
- "skipAnalysis": "不,进行分析", + "skipAnalysis": "不,跳过分析", "enableAnalysis": "是,启用分析"This changes it to "No, skip analysis" which correctly matches the semantic intent.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json` around lines 206 - 208, The translation for the key "skipAnalysis" is inverted; update the value for "skipAnalysis" in taskReview.json from "不,进行分析" to a correct phrase such as "不,跳过分析" so the displayed text matches the intent of skipping analysis (check the "skipAnalysis" key and adjust the string accordingly).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/src/shared/constants/i18n.ts`:
- Around line 6-11: Add Chinese mappings to the spellcheck constants so
selecting 'zh' in SupportedLanguage / AVAILABLE_LANGUAGES has proper
spellchecker locales and localized UI; update SPELL_CHECK_LANGUAGE_MAP to
include a 'zh' key mapping to Chromium locales such as 'zh-CN' and 'zh-TW' and
add a 'zh' entry to ADD_TO_DICTIONARY_LABELS with the Chinese label (e.g.,
"添加到词典") so lookups that use SPELL_CHECK_LANGUAGE_MAP and
ADD_TO_DICTIONARY_LABELS (and their fallbacks like DEFAULT_SPELL_CHECK_LANGUAGE
and getAppLanguage()) will return correct values when language is 'zh'.
---
Duplicate comments:
In `@apps/desktop/src/shared/i18n/locales/zh/taskReview.json`:
- Around line 206-208: The translation for the key "skipAnalysis" is inverted;
update the value for "skipAnalysis" in taskReview.json from "不,进行分析" to a
correct phrase such as "不,跳过分析" so the displayed text matches the intent of
skipping analysis (check the "skipAnalysis" key and adjust the string
accordingly).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 937a1b12-8c16-478c-ba6f-575c9461af6c
📒 Files selected for processing (4)
apps/desktop/src/shared/constants/i18n.tsapps/desktop/src/shared/i18n/locales/zh/dialogs.jsonapps/desktop/src/shared/i18n/locales/zh/taskReview.jsonapps/desktop/src/shared/i18n/locales/zh/terminal.json
| export type SupportedLanguage = 'en' | 'fr' | 'zh'; | ||
|
|
||
| export const AVAILABLE_LANGUAGES = [ | ||
| { value: 'en' as const, label: 'English', nativeLabel: 'English' }, | ||
| { value: 'fr' as const, label: 'French', nativeLabel: 'Français' } | ||
| { value: 'fr' as const, label: 'French', nativeLabel: 'Français' }, | ||
| { value: 'zh' as const, label: 'Chinese', nativeLabel: '中文' } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check available Chinese spell check languages in Electron
# Search for Electron spell checker documentation or check the codebase
rg -n "availableSpellCheckerLanguages" -A 5 -B 5 --type=ts
# Also check if there are any existing references to Chinese language codes
rg -n "zh-CN|zh-TW|zh_CN|zh_TW" --type=tsRepository: AndyMik90/Aperant
Length of output: 2193
🏁 Script executed:
# Check the current state of spellcheck.ts
cat -n apps/desktop/src/shared/constants/spellcheck.tsRepository: AndyMik90/Aperant
Length of output: 1244
🏁 Script executed:
# Check the context menu behavior in index.ts around lines 303-310
sed -n '295,320p' apps/desktop/src/main/index.tsRepository: AndyMik90/Aperant
Length of output: 1137
🏁 Script executed:
# Verify the fallback logic in index.ts around lines 269-276
sed -n '260,285p' apps/desktop/src/main/index.tsRepository: AndyMik90/Aperant
Length of output: 1357
🏁 Script executed:
# Search for comments or documentation about spell checker language codes
rg -n "spell.*check.*lang|Chromium.*spell|availableSpellCheckerLanguages" -B 3 -A 3 --type=ts apps/desktop/srcRepository: AndyMik90/Aperant
Length of output: 9206
🏁 Script executed:
# Check if there are any tests or examples of SPELL_CHECK_LANGUAGE_MAP usage
rg -n "SPELL_CHECK_LANGUAGE_MAP" -B 2 -A 2 --type=ts apps/desktop/srcRepository: AndyMik90/Aperant
Length of output: 2872
🏁 Script executed:
# Check Electron version
cat apps/desktop/package.json | grep -A 2 -B 2 '"electron"'Repository: AndyMik90/Aperant
Length of output: 212
🏁 Script executed:
# Search for any existing Chinese language references or comments
rg -n "Chinese|中文|zh-" --type=ts --type=json apps/desktop/srcRepository: AndyMik90/Aperant
Length of output: 250
🏁 Script executed:
# Check if there are any language code patterns or documentation in the codebase
rg -n "fr-FR|en-US|en-GB" --type=ts apps/desktop/srcRepository: AndyMik90/Aperant
Length of output: 2194
🌐 Web query:
Electron 40.0 Chromium spell checker available languages zh-CN zh-TW Chinese support
💡 Result:
In Electron 40.0.0 (based on Chromium 144.0.7559.60), the built-in spell checker supports Chinese (Simplified, zh-CN) and Chinese (Traditional, zh-TW) on Windows and Linux via Chromium's Hunspell dictionaries. These languages are part of Chromium's supported spellcheck languages, as Chromium's Hunspell dictionaries include support for numerous languages including zh-CN and zh-TW (evidenced by Chromium's deps/hunspell_dictionaries repo listing extensive language support and Chromium's general multilingual spellcheck capabilities). On macOS, it uses native APIs which automatically detect languages, including Chinese variants. To check available languages in code: webContents.session.availableSpellCheckerLanguages. To set: session.setSpellCheckerLanguages(['zh-CN', 'zh-TW']). Dictionaries are downloaded from Google's CDN by default.
Citations:
- 1: https://electronjs.org/docs/latest/tutorial/spellchecker
- 2: https://electron.atom.io/docs/latest/tutorial/spellchecker
- 3: https://github.com/electron/electron/releases/tag/v40.0.0
- 4: https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/refs/heads/main
- 5: https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master
- 6: https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/refs/heads/main/README.chromium
- 7: https://www.electronjs.org/docs/latest/tutorial/spellchecker/
🏁 Script executed:
# Check if there are any TODOs or comments related to Chinese language or spell check
rg -n "TODO|FIXME|XXX" -i --type=ts apps/desktop/src/shared/constants/ | head -20Repository: AndyMik90/Aperant
Length of output: 43
Add Chinese spell check mappings to complete language support.
Adding 'zh' to SupportedLanguage and AVAILABLE_LANGUAGES in apps/desktop/src/shared/constants/i18n.ts without corresponding entries in SPELL_CHECK_LANGUAGE_MAP and ADD_TO_DICTIONARY_LABELS in apps/desktop/src/shared/constants/spellcheck.ts leaves the feature incomplete.
When Chinese is selected:
- Spell checker will silently fall back to English (via the
SPELL_CHECK_LANGUAGE_MAP[language] || [DEFAULT_SPELL_CHECK_LANGUAGE]fallback inapps/desktop/src/main/ipc-handlers/settings-handlers.ts:858) - Context menu will display "Add to Dictionary" in English instead of Chinese (via the
ADD_TO_DICTIONARY_LABELS[getAppLanguage()] || ADD_TO_DICTIONARY_LABELS['en']fallback inapps/desktop/src/main/index.ts:305-306)
🛠️ Proposed fix - add Chinese spell check mappings
Add the following entries to apps/desktop/src/shared/constants/spellcheck.ts:
export const SPELL_CHECK_LANGUAGE_MAP: Record<string, string[]> = {
en: ['en-US', 'en-GB'],
fr: ['fr-FR', 'fr'],
zh: ['zh-CN', 'zh-TW'],
};
export const ADD_TO_DICTIONARY_LABELS: Record<string, string> = {
en: 'Add to Dictionary',
fr: 'Ajouter au dictionnaire',
zh: '添加到词典',
};Both zh-CN and zh-TW are supported by Chromium's spell checker in Electron 40.0.0 on Windows, Linux, and macOS.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/desktop/src/shared/constants/i18n.ts` around lines 6 - 11, Add Chinese
mappings to the spellcheck constants so selecting 'zh' in SupportedLanguage /
AVAILABLE_LANGUAGES has proper spellchecker locales and localized UI; update
SPELL_CHECK_LANGUAGE_MAP to include a 'zh' key mapping to Chromium locales such
as 'zh-CN' and 'zh-TW' and add a 'zh' entry to ADD_TO_DICTIONARY_LABELS with the
Chinese label (e.g., "添加到词典") so lookups that use SPELL_CHECK_LANGUAGE_MAP and
ADD_TO_DICTIONARY_LABELS (and their fallbacks like DEFAULT_SPELL_CHECK_LANGUAGE
and getAppLanguage()) will return correct values when language is 'zh'.
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit