cmux-localization

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cmux Localization

cmux 本地化

Use this skill for any user-facing string change.
任何涉及用户可见字符串修改的操作,请遵循此规范。

Hard rules

硬性规则

  • All user-facing strings must be localized.
  • Use
    String(localized: "key.name", defaultValue: "English text")
    for Swift/AppKit/SwiftUI strings.
  • Keys go in
    Resources/Localizable.xcstrings
    with translations for all supported languages, currently English and Japanese.
  • Never use bare string literals in SwiftUI
    Text()
    ,
    Button()
    , alert titles, tooltips, menus, or dialogs.
  • Localization audit is required for every user-facing change.
  • defaultValue
    , English fallback text, schema descriptions, or copied English strings do not count as localization.
  • For localized web/docs content, update every supported message catalog, currently
    web/messages/en.json
    and
    web/messages/ja.json
    , plus any localized data structures carrying inline translations.
  • 所有用户可见字符串必须进行本地化处理。
  • Swift/AppKit/SwiftUI 字符串请使用
    String(localized: "key.name", defaultValue: "English text")
    语法。
  • 键值需存入
    Resources/Localizable.xcstrings
    ,并包含所有支持语言的翻译版本,目前支持英语和日语。
  • 绝不能在 SwiftUI 的
    Text()
    Button()
    、提示框标题、工具提示、菜单或对话框中直接使用字符串字面量。
  • 所有用户可见内容的修改都必须经过本地化审核。
  • defaultValue
    (英文回退文本)、架构描述或复制的英文字符串均不算作本地化处理。
  • 针对本地化的网页/文档内容,需更新所有支持的消息目录,目前包括
    web/messages/en.json
    web/messages/ja.json
    ,以及任何包含内嵌翻译的本地化数据结构。

Audit checklist

审核清单

Before finishing a task that changes UI, Settings rows, menus, shortcut metadata, schema/config text, docs, command/help text, alerts, or tooltips:
  1. Enumerate the changed user-facing surfaces.
  2. Verify each surface has entries for every supported locale.
  3. Parse touched localization files.
  4. Compare changed message keys across locales.
  5. Use
    rg
    over changed Swift/TS/TSX/docs files for newly introduced bare English.
  6. State the localization audit in the final handoff, or explicitly say what could not be verified.
在完成涉及界面、设置项、菜单、快捷键元数据、配置/架构文本、文档、命令/帮助文本、提示框或工具提示修改的任务前:
  1. 列出所有修改涉及的用户可见内容区域。
  2. 验证每个区域在所有支持的语言环境下都有对应的条目。
  3. 解析涉及的本地化文件。
  4. 对比不同语言环境下修改的消息键值。
  5. 使用
    rg
    工具扫描修改后的 Swift/TS/TSX/文档文件,检查是否新增了未本地化的英文文本。
  6. 在最终交付时说明本地化审核情况,或明确指出无法验证的内容。

Related shortcut rule

相关快捷键规则

Every new cmux-owned keyboard shortcut must be added to
KeyboardShortcutSettings
, visible/editable in Settings, supported in
~/.config/cmux/cmux.json
, and documented in the keyboard shortcut and configuration docs.
每个 cmux 新增的键盘快捷键都必须添加至
KeyboardShortcutSettings
,可在设置中查看/编辑,支持在
~/.config/cmux/cmux.json
中配置,并在键盘快捷键和配置文档中进行记录。

Detailed reference

详细参考

  • Read references/audit-workflow.md for a deeper audit process, common false positives, and examples of surfaces that count as user-facing.
  • 阅读 references/audit-workflow.md 了解更深入的审核流程、常见误判情况,以及属于用户可见内容的示例。