Skip to content

Complete Simplified Chinese (zh-Hans) localization - #12052

Closed
mengyang0007-dev wants to merge 1 commit into
manaflow-ai:mainfrom
mengyang0007-dev:zh-hans-localization
Closed

mengyang0007-dev wants to merge 1 commit into
manaflow-ai:mainfrom
mengyang0007-dev:zh-hans-localization

Conversation

@mengyang0007-dev

@mengyang0007-dev mengyang0007-dev commented Sep 6, 2026 •

Copy link
Copy Markdown

Summary

This brings zh-Hans in the macOS string catalogs from partial to effectively
complete, and makes the pre-existing Chinese translations terminologically
consistent with each other.

Catalog zh-Hans before zh-Hans after Keys
Resources/Localizable.xcstrings 1837 5707 5890
Resources/InfoPlist.xcstrings 13 29 29
Packages/macOS/CmuxSwiftRenderUI/.../Localizable.xcstrings 0 3 3

In the main catalog: 3870 keys newly translated, 367 existing values
revised
, and 146 entries promoted out of a non-final state (137
needs_review, 9 new) to translated. No entry is left in needs_review
or new.

Nothing but zh-Hans is touched. No en, ja or other locale value, and no
entry-level metadata, differs from the previous revision.

Coverage and what is deliberately left in English

183 of 5890 keys carry no zh-Hans entry on purpose, because a "translation"
would only duplicate the English and would read as a placeholder:

  • Product and brand names — Claude Code, Codex, OpenCode, Kimi Code, Ollama, Cursor, Copilot, Gemini, Grok, Ghostty,
    Tailscale, Iroh, Discord, cmux Pro.
  • Technical acronyms and identifiers — UDID, PID, CPU, URL,
    LTE, 5G, Wi-Fi, Face ID, HomeKit, Siri, VoiceOver,
    WebView, AppKit, SwiftUI, React, Solid.
  • Format-only strings — %1$@: %2$@, %@ • %@, %@ px, PID %lld,
    :%lld, ⌘↩.
  • Price and plan literals — $0, $50, $0.40, 4 vCPU / 16 GB,
    SOC 2.
  • CLI usage fragments that are pure syntax — e.g.
    viewport <width> <height> | reset.

This follows the repo's own review rule against "placeholder, copied
English, machine marker, TODO, or empty translations used to satisfy a
locale slot" (.github/review-bot-rules/full-internationalization.md).

Terminology

The catalog previously used several Chinese words interchangeably for the
same cmux concept — pane appeared as both 窗格 and 面板, split as both
拆分 and 分屏, surface as 表面, 界面 and an untranslated Surface. Since
panel is its own distinct concept in cmux, pane→面板 was actively
misleading. This PR
settles on one word per concept and rewrites the 47 entries that disagreed:

English zh-Hans Note
workspace 工作区
tab 标签页
pane 窗格
panel 面板 kept distinct from pane
surface 表面
split 拆分
sidebar 侧边栏
agent 代理
browser 浏览器
remove 移除 vs. delete → 删除
OK / Cancel 确定 / 取消 macOS convention

Other conventions applied throughout:

  • Ellipsis follows the English source character for character. A source
    … stays …; a source ... stays .... Menu items and CLI output in
    this repo use both, and they now match one-to-one.
  • CLI help text translates the prose and leaves the machine parts alone.
    Flag names, subcommands, option columns, env vars, config keys and example
    command lines stay verbatim; only descriptions and section headers are
    translated (用法: / 标志: / 示例:), matching the style of the CLI
    help strings that were already translated.
  • Keyboard shortcut text, bundle ids, socket names and file paths are
    never translated.
  • InfoPlist.xcstrings keeps its own register. The 13 pre-existing
    entries address the user as 您; the 16 added ones do the same, rather
    than importing the 你 used in the app UI.
  • settings.search.* alias strings keep their English keywords and append
    Chinese ones
    , which is what the 110 already-translated alias entries in
    this catalog do — Chinese users can then find a setting by either.

Keys whose English changed upstream

65 keys had their English source edited since the previous zh-Hans pass —
most of them the Stack → cmux rename in the sign-in flow (e.g.
account.signIn.error.network.title: "Couldn't reach Stack" → "Couldn't
reach cmux"). Those were re-translated from the current English rather than
carried over, so no stale product name survives in Chinese.

How to verify

No Xcode build is required to check this diff.

  1. All three catalogs still parse.

    for f in Resources/Localizable.xcstrings Resources/InfoPlist.xcstrings \
      Packages/macOS/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings; do
      python3 -c "import json,sys; json.load(open(sys.argv[1])); print('ok', sys.argv[1])" "$f"
    done
  2. Nothing outside zh-Hans moved. For each catalog, compare every
    locale except zh-Hans, plus the entry metadata and the top-level keys,
    against origin/main:

    python3 - <<'EOF'
    import json, subprocess
    for f in ["Resources/Localizable.xcstrings", "Resources/InfoPlist.xcstrings",
              "Packages/macOS/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings"]:
        old = json.loads(subprocess.check_output(["git", "show", f"origin/main:{f}"]))
        new = json.load(open(f))
        bad = [(k, loc)
               for k, v in old["strings"].items()
               for loc in set(v["localizations"]) | set(new["strings"][k]["localizations"])
               if loc != "zh-Hans"
               and v["localizations"].get(loc) != new["strings"][k]["localizations"].get(loc)]
        meta = set(old) == set(new) and all(old[k] == new[k] for k in old if k != "strings")
        print(f, "non-zh-Hans diffs:", len(bad), "| metadata identical:", meta)
    EOF
  3. Placeholders and line breaks match English. Every zh-Hans value this
    PR writes has the same printf placeholder multiset (%@, %lld,
    %1$@, %d, %s, %.0f) and the same \n count as its English source:

    python3 - <<'EOF'
    import json, re, collections
    PH = re.compile(r"%(\d+\$)?[0-9.]*(l{0,2}[@dfsuxi]|@)")
    for f in ["Resources/Localizable.xcstrings", "Resources/InfoPlist.xcstrings",
              "Packages/macOS/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings"]:
        bad = []
        for k, v in json.load(open(f))["strings"].items():
            z = v["localizations"].get("zh-Hans")
            if not z:
                continue
            e = v["localizations"]["en"]["stringUnit"]["value"]
            c = z["stringUnit"]["value"]
            if (collections.Counter(m.group(0) for m in PH.finditer(e))
                    != collections.Counter(m.group(0) for m in PH.finditer(c))
                    or e.count("\n") != c.count("\n")):
                bad.append(k)
        print(f, "mismatches:", len(bad))
    EOF

    This reports 38 keys in Resources/Localizable.xcstrings, and all 38
    are pre-existing values this PR does not touch
    (see "Pre-existing
    issues" below). Every value the PR writes matches.

  4. Formatting. The catalogs were edited by splicing only the zh-Hans
    members, so indentation, key order and every other byte are unchanged;
    git diff shows added/replaced "zh-Hans" blocks and nothing else.

Pre-existing issues found but not changed here

These are left alone to keep this PR translation-only. Happy to send
separate PRs if you want them fixed.

  1. 127 string entries in Resources/Localizable.xcstrings sit outside the
    "strings" object.
    From line 292853 the file closes "strings" and
    then continues with entries such as
    "browser.chromium.automation.commandTimedOut" as siblings of
    "sourceLanguage" / "strings" / "version", in compact one-line JSON
    rather than the file's indented style. A String Catalog only reads
    strings, so these 127 keys — the Chromium browser engine errors, the
    split-button debug menu, the Cloud VM tunnel and cmux vpn status
    strings, and the settings.browser.* engine rows — are invisible to
    Xcode and ship untranslated in every locale, English included. They look
    like the output of a script that appended to the wrong nesting level.

  2. 38 existing zh-Hans values drift from their English source. 32 are
    settings.search.alias.* entries carrying a trailing • %@ that the
    English does not have; 6 are CLI help strings
    (cli.help.mosh, cli.help.ssh.mosh, cli.help.clearNotifications,
    cli.help.reorderWorkspaces, cli.comments.usage, cli.restore.help)
    whose Chinese has a different line count from the English, so their
    wrapped help output does not line up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ea6L3DAe659mCmXwU4T7Hu


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Completes zh-Hans localization across all three macOS string catalogs, raising the main catalog from 1,837 to 5,707 translated keys and unifying previously inconsistent Chinese terminology. Only zh-Hans values change; no other locale or entry-level metadata is touched.

Coverage

  • 3,870 keys newly translated, 367 revised, and 146 promoted from needs_review/new to translated; no entries remain in a non-final state.
  • Resources/InfoPlist.xcstrings and the CmuxSwiftRenderUI package catalog are now complete (29 and 3 keys respectively).
  • 183 keys intentionally carry no zh-Hans: brand names, technical acronyms, format-only strings, and price/plan literals where a translation would only duplicate English.

Terminology and conventions

  • Unifies previously conflicting terms: pane→窗格, panel→面板, split→拆分, surface→表面, sidebar→侧边栏, agent→代理.
  • Ellipsis characters, printf placeholders, and newline counts match the English source one-to-one.
  • Product names, CLI flags, subcommands, env vars, and file paths stay untranslated.
  • 65 keys whose English source changed upstream were re-translated from the current text.
  • Found pre-existing issues (127 keys outside the strings object and 38 zh-Hans values drifting from English) but left them for separate PRs.

Written for commit ac6b0c8. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Localization
    • Added Simplified Chinese translations for sidebar messages.
    • Added Simplified Chinese translations for app permission and resource access descriptions.

Brings zh-Hans in the macOS string catalogs from partial to effectively
complete, and makes the existing translations terminologically consistent.

Resources/Localizable.xcstrings (5890 keys)
  zh-Hans entries: 1837 -> 5707 (96.9% of all keys)
  - 3870 keys newly translated
  - 367 existing values revised
  - 146 entries promoted out of a non-final state
    (137 needs_review, 9 new) -> translated
  - 0 entries left in needs_review or new
  - 183 keys intentionally carry no zh-Hans: product and brand names,
    technical acronyms, price literals, and format-only strings
    (e.g. "%1$@: %2$@", "%@ px", "PID %lld") where a translation would
    only duplicate English

Resources/InfoPlist.xcstrings
  zh-Hans entries: 13 -> 29 (complete); the 16 additions follow the
  wording and register already used by the existing 13.

Packages/macOS/CmuxSwiftRenderUI/.../Localizable.xcstrings
  zh-Hans entries: 0 -> 3 (complete)

Terminology unified across old and new translations
  workspace -> 工作区   tab -> 标签页      pane -> 窗格
  panel -> 面板         surface -> 表面    split -> 拆分
  sidebar -> 侧边栏     agent -> 代理      browser -> 浏览器
  remove -> 移除        OK -> 确定         Cancel -> 取消
  47 previously inconsistent entries were rewritten to this glossary;
  the catalog had used 窗格/面板 interchangeably for pane, 拆分/分屏
  for split, and 表面/界面/Surface for surface.

Other conventions
  - Ellipsis follows the English source character for character:
    "…" stays "…", "..." stays "...".
  - Product names, CLI subcommands, flags, key names, config keys and
    environment variables are never translated; CLI help text keeps its
    flag columns in English and translates only the prose.
  - 65 keys whose English source changed upstream since the previous
    zh-Hans pass were re-translated rather than carried over.

Verification
  - All three catalogs parse as JSON.
  - Every zh-Hans value has a printf placeholder multiset and newline
    count identical to its English source, for all values this change
    writes.
  - No en, ja or any other locale value, and no entry-level metadata,
    differs from the previous revision; the diff is zh-Hans only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@mengyang0007-dev is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 7565e946-5f2c-4dc4-a2fd-6d2633f2cf04

📥 Commits

Reviewing files that changed from the base of the PR and between 167bfea and ac6b0c8.

📒 Files selected for processing (3)
  • Packages/macOS/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings
  • Resources/InfoPlist.xcstrings
  • Resources/Localizable.xcstrings

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

This change adds Simplified Chinese (zh-Hans) translations for three sidebar messages and 16 Info.plist usage-description strings.

Changes

Simplified Chinese localization

Layer / File(s) Summary
Sidebar localization
Packages/macOS/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings
Adds translated zh-Hans entries for three custom sidebar messages.
Usage-description localization
Resources/InfoPlist.xcstrings
Adds translated zh-Hans entries for 16 usage-description strings.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to ac6b0

This change adds Simplified Chinese sidebar text and macOS usage descriptions without altering application behavior or permissions. No current merge-blocking risk remains.

Suggested reviewers: austinywang

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: completing Simplified Chinese localization.
Description check ✅ Passed The description is detailed and directly related to the localization changes. It explains scope, terminology, verification steps, and pre-existing issues. It does not include the template's Demo Video…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS: The pull request changes only three .xcstrings localization catalogs. The diff has no .swift paths and no non-.xcstrings patch content. Therefore it introduces no Swift declaration or acce…
Cmux Swift Blocking Runtime ✅ Passed PASS: The PR changes only three .xcstrings localization resources; the commit diff contains no .swift paths. Structural comparison with the parent shows changes only under zh-Hans in all three c…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only three .xcstrings resource files. The semantic diff shows only zh-Hans localization changes; no Swift source, processV2Command, socketWorkerMethods, worker-r…
Cmux Expensive Synchronous Load ✅ Passed PASS: The pull-request diff changes only three .xcstrings localization resources. The direct HEAD^..HEAD diff contains no Swift, Objective-C, JSON/JSONL, or other production source changes, and no…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only three .xcstrings localization resources. The diff contains no Swift, TypeScript, or JavaScript production changes, so it cannot replace an authoritative persisten…
Cmux No Hacky Sleeps ✅ Passed The check is not applicable to this pull request. The diff against origin/main contains only three .xcstrings localization catalogs. No TypeScript, JavaScript, shell, build, or runtime script chan…
Cmux Algorithmic Complexity ✅ Passed PASS: The diff against origin/main changes only three .xcstrings resource catalogs. No Swift, TypeScript, JavaScript, shell, or other runtime code changed. The added and revised zh-Hans values c…
Cmux Swift Concurrency ✅ Passed PASS: The PR diff contains only three .xcstrings localization resources. The changed paths are Packages/macOS/CmuxSwiftRenderUI/.../Localizable.xcstrings, Resources/InfoPlist.xcstrings, and `Res…
Cmux Swift @Concurrent ✅ Passed PASS: The pull request diff contains only three .xcstrings resource files and no .swift files. It introduces no Swift functions, async work, actor-isolation changes, @concurrent annotations, o…
Cmux Swift Package Boundaries ✅ Passed PASS: The pull request changes only three .xcstrings localization resources. The diff contains no Swift source file or Package.swift change, and therefore introduces no production Swift logic that…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

Warning

⚠️ This pull request shows signs of AI-generated slop (ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

@mengyang0007-dev

Copy link
Copy Markdown
Author

I have read the CLA Document v2.2 and I hereby sign the CLA

@teamleaderleo

Copy link
Copy Markdown
Collaborator

Thank you for this! The Simplified Chinese macOS catalog is already complete on main through #12169, so this PR is superseded and I’m closing it :)

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