Skip to content

Add Chinese (zh) language support#2009

Open
RootInsect wants to merge 8 commits intoAndyMik90:developfrom
RootInsect:feature/zh-cn
Open

Add Chinese (zh) language support#2009
RootInsect wants to merge 8 commits intoAndyMik90:developfrom
RootInsect:feature/zh-cn

Conversation

@RootInsect
Copy link
Copy Markdown

@RootInsect RootInsect commented Apr 13, 2026

Summary

  • Add Chinese translation files for all 11 namespaces (common, navigation, settings, tasks, welcome, onboarding, dialogs, gitlab, taskReview, terminal, errors)
  • Register zh language in i18n configuration

Test plan

  • Verify Chinese language appears in language selector in Settings
  • Test that all UI text displays correctly in Chinese

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Simplified Chinese localization across the desktop app (navigation, settings, onboarding, tasks, dialogs, terminal/PR flows, errors, GitLab integration, welcome, and more).
    • Exposed Chinese (zh) in the app language list and language selection UI.

- 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>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Added Simplified Chinese (zh) translations across the desktop app: 11 new locale JSON files and registration of the zh namespace in i18n; also extended supported languages to include zh in constants.

Changes

Cohort / File(s) Summary
i18n Index & Language Constants
apps/desktop/src/shared/i18n/index.ts, apps/desktop/src/shared/constants/i18n.ts
Registered zh namespace in i18n resources and added 'zh' to SupportedLanguage and AVAILABLE_LANGUAGES.
Core UI / Common
apps/desktop/src/shared/i18n/locales/zh/common.json
New Chinese translations for general UI components, labels, buttons, errors, progress, and many interpolated/pluralized strings.
Navigation & Welcome
apps/desktop/src/shared/i18n/locales/zh/navigation.json, apps/desktop/src/shared/i18n/locales/zh/welcome.json
Added Chinese navigation strings, update banner/Claude Code texts, and welcome screen copy.
Onboarding & Settings
apps/desktop/src/shared/i18n/locales/zh/onboarding.json, apps/desktop/src/shared/i18n/locales/zh/settings.json
Added comprehensive Chinese translations for onboarding flows, account/provider setup, memory/configuration, and settings panels.
Tasks, Task Review & Dialogs
apps/desktop/src/shared/i18n/locales/zh/tasks.json, apps/desktop/src/shared/i18n/locales/zh/taskReview.json, apps/desktop/src/shared/i18n/locales/zh/dialogs.json
Added Chinese strings for task lifecycle, queues, kanban, PR/merge flows, task-review UI, and numerous dialog prompts/placeholders.
Integrations & Terminal
apps/desktop/src/shared/i18n/locales/zh/gitlab.json, apps/desktop/src/shared/i18n/locales/zh/terminal.json
Added Chinese translations for GitLab integration (issues/MRs/review findings) and terminal/worktree-related UI.
Errors
apps/desktop/src/shared/i18n/locales/zh/errors.json
Added Chinese error messages related to task JSON/implementation plan parsing and JSON error descriptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble keys and weave each phrase,
zh whispers now in menus' maze,
Eleven files hopped into place,
Buttons, tips, and dialogs embrace,
A tiny hop — localization praised ✨

🚥 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 The title 'Add Chinese (zh) language support' directly and clearly summarizes the main change: adding comprehensive Chinese language localization across all 11 translation namespaces and registering the new language in the i18n configuration.
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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🎉 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!

Comment on lines +74 to 84
navigation: zhNavigation,
settings: zhSettings,
tasks: zhTasks,
welcome: zhWelcome,
onboarding: zhOnboarding,
dialogs: zhDialogs,
gitlab: zhGitlab,
taskReview: zhTaskReview,
terminal: zhTerminal,
errors: zhErrors
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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"页面时使用。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value. Double quotes within a JSON string must be escaped with a backslash (e.g., \").

    "fallbackNote": "仅在浏览器中看到\"将此粘贴到 Claude Code\"页面时使用。",

"addAccountsDesc": "添加并验证您的 Claude 账户以使用 AI 功能。",
"multiAccountInfo": "您可以添加多个 Claude 账户。活跃账户将用于 AI 功能。您可以随时切换账户。",
"keychainTitle": "安全存储",
"keychainDescription": "您的身份验证令牌使用系统密钥链加密存储。您可能会看到 macOS 的密码提示 - 点击"始终允许"以避免再次看到。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

    "keychainDescription": "您的身份验证令牌使用系统密钥链加密存储。您可能会看到 macOS 的密码提示 - 点击\"始终允许\"以避免再次看到。",

"instructions": "验证此个人资料:",
"step1": "转到设置 > 集成",
"step2": "在 Claude 账户部分找到该个人资料",
"step3": "点击"验证"完成登录",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

    "step3": "点击\"验证\"完成登录",

"showLessFeatures": "显示更少",
"archiveFeature": "归档",
"archiveFeatureConfirmTitle": "归档功能?",
"archiveFeatureConfirmDescription": "这将从您的路线图中移除"{{title}}"。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

    "archiveFeatureConfirmDescription": "这将从您的路线图中移除\"{{title}}\"",

"autoSyncDescription": "项目加载时自动获取问题",
"cli": {
"required": "需要 GitLab CLI",
"notInstalled": "GitLab CLI(glab)需要用于 OAuth 身份验证。安装它以使用"使用 OAuth"选项。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

Suggested change
"notInstalled": "GitLab CLI(glab)需要用于 OAuth 身份验证。安装它以使用"使用 OAuth"选项。",
"notInstalled": "GitLab CLI(glab)需要用于 OAuth 身份验证。安装它以使用\"使用 OAuth\"选项。",

"requireReviewDescription": "启用后,系统将提示您审核规格和实施计划,然后再开始编码阶段。这允许您批准、请求更改或提供反馈。",
"fastModeLabel": "快速模式",
"fastModeDescription": "相同的 Opus 4.6 模型,输出更快。每令牌成本更高。",
"fastModeNotice": "需要您的 Claude 订阅启用"额外使用"。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

    "fastModeNotice": "需要您的 Claude 订阅启用\"额外使用\"",

"instructions": "重新验证:",
"step1": "转到设置",
"step2": "导航到应用设置 > 集成",
"step3": "点击您个人资料上的"重新验证"",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Invalid JSON syntax: unescaped double quotes inside the string value.

Suggested change
"step3": "点击您个人资料上的"重新验证"",
"step3": "点击您个人资料上的\"重新验证\"",

Comment on lines +617 to +618
"stepReturnAndVerify": "返回此处并点击 <strong>验证验证</strong>",
"verifyAuth": "验证验证",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The translation "验证验证" (Verify Verification) is redundant and likely a literal translation error. "身份验证" is the standard term for "Authentication" in software localization.

    "stepReturnAndVerify": "返回此处并点击 <strong>验证身份验证</strong>",
    "verifyAuth": "验证身份验证",

"suggestsFeatures": "建议解决竞争对手产品差距的功能",
"webSearchesTitle": "将执行网络搜索",
"webSearchesDescription": "此功能将执行网络搜索以收集竞争对手信息。您的项目名称和类型将用于搜索查询。不会共享任何代码或敏感数据。",
"optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo: "果程图" should be "路线图" (Roadmap).

    "optionalInfo": "如果您愿意,可以生成路线图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。",

"aiCommitMessage": "AI 生成的提交消息",
"copied": "已复制!",
"copy": "复制",
"editHint": "根据需要编辑,然后复制并配合",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Mistranslation: "配合" (coordinate/cooperate) is likely a mistake for "粘贴" (paste) in this context.

    "editHint": "根据需要编辑,然后复制并粘贴",

Copy link
Copy Markdown
Contributor

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between cba7a02 and 4a2aa9f.

📒 Files selected for processing (12)
  • apps/desktop/src/shared/i18n/index.ts
  • apps/desktop/src/shared/i18n/locales/zh/common.json
  • apps/desktop/src/shared/i18n/locales/zh/dialogs.json
  • apps/desktop/src/shared/i18n/locales/zh/errors.json
  • apps/desktop/src/shared/i18n/locales/zh/gitlab.json
  • apps/desktop/src/shared/i18n/locales/zh/navigation.json
  • apps/desktop/src/shared/i18n/locales/zh/onboarding.json
  • apps/desktop/src/shared/i18n/locales/zh/settings.json
  • apps/desktop/src/shared/i18n/locales/zh/taskReview.json
  • apps/desktop/src/shared/i18n/locales/zh/tasks.json
  • apps/desktop/src/shared/i18n/locales/zh/terminal.json
  • apps/desktop/src/shared/i18n/locales/zh/welcome.json

Comment thread apps/desktop/src/shared/i18n/locales/zh/common.json Outdated
Comment on lines +1 to +58
{
"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。"
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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.")
PY

Repository: 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
done

Repository: 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
fi

Repository: 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")
PYEND

Repository: 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.json contains 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.

Comment thread apps/desktop/src/shared/i18n/locales/zh/taskReview.json
Comment thread apps/desktop/src/shared/i18n/locales/zh/tasks.json Outdated
RootInsect and others added 4 commits April 14, 2026 00:03
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>
Copy link
Copy Markdown
Contributor

@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: 1

♻️ Duplicate comments (1)
apps/desktop/src/shared/i18n/locales/zh/taskReview.json (1)

1-13: ⚠️ Potential issue | 🟠 Major

taskReview still missing required terminal subsection

This file still lacks terminal.openTerminal, terminal.openInbuilt, and terminal.openExternal, so consumers of taskReview terminal 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2aa9f and c263e17.

📒 Files selected for processing (7)
  • apps/desktop/src/shared/i18n/locales/zh/common.json
  • apps/desktop/src/shared/i18n/locales/zh/gitlab.json
  • apps/desktop/src/shared/i18n/locales/zh/onboarding.json
  • apps/desktop/src/shared/i18n/locales/zh/settings.json
  • apps/desktop/src/shared/i18n/locales/zh/taskReview.json
  • apps/desktop/src/shared/i18n/locales/zh/tasks.json
  • apps/desktop/src/shared/i18n/locales/zh/terminal.json

Comment on lines +206 to +208
"optionalInfo": "如果您愿意,可以生成果程图而不进行竞争对手分析。路线图仍将基于您的项目结构和最佳实践。",
"skipAnalysis": "不,进行分析",
"enableAnalysis": "是,启用分析",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
"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.

RootInsect and others added 3 commits April 14, 2026 01:07
…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>
Copy link
Copy Markdown
Contributor

@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: 1

♻️ Duplicate comments (1)
apps/desktop/src/shared/i18n/locales/zh/taskReview.json (1)

206-208: ⚠️ Potential issue | 🟠 Major

Fix 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

📥 Commits

Reviewing files that changed from the base of the PR and between c263e17 and f7e6a6c.

📒 Files selected for processing (4)
  • apps/desktop/src/shared/constants/i18n.ts
  • apps/desktop/src/shared/i18n/locales/zh/dialogs.json
  • apps/desktop/src/shared/i18n/locales/zh/taskReview.json
  • apps/desktop/src/shared/i18n/locales/zh/terminal.json

Comment on lines +6 to +11
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: '中文' }
Copy link
Copy Markdown
Contributor

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:

#!/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=ts

Repository: AndyMik90/Aperant

Length of output: 2193


🏁 Script executed:

# Check the current state of spellcheck.ts
cat -n apps/desktop/src/shared/constants/spellcheck.ts

Repository: 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.ts

Repository: 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.ts

Repository: 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/src

Repository: 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/src

Repository: 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/src

Repository: 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/src

Repository: 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:


🏁 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 -20

Repository: 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 in apps/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 in apps/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'.

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.

2 participants