首页 · 安装指南 · Docker 部署 · 常见问题 · 贡献指南 · 翻译规范
感谢你对 **OpenClaw 汉化发行版** 的关注! --- ## 目录 - [环境准备](#setup) - [项目结构](#structure) - [汉化 CLI 工具](#cli-tool) - [手动汉化安装](#manual-install) - [添加新翻译](#add-translation) - [翻译规范](#translation-rules) - [提交 PR](#submit-pr) - [行为准则](#code-of-conduct) - [联系我们](#contact) --- ## 环境准备 ```bash # 1. 克隆汉化项目 git clone https://github.com/1186258278/OpenClawChineseTranslation.git cd OpenClawChineseTranslation # 2. 克隆上游 OpenClaw 源码 git clone https://github.com/openclaw/openclaw.git openclaw ``` --- ## 项目结构 ``` OpenClawChineseTranslation/ ├── cli/ # 汉化 CLI 工具 │ ├── index.mjs # 入口 │ ├── commands/ # 命令实现(apply, restore, status) │ └── utils/ # 工具函数(i18n 引擎) ├── translations/ # 翻译配置(JSON 格式) │ ├── config.json # 主配置(加载所有翻译文件) │ ├── cli/ # CLI 界面翻译 │ │ ├── banner.json # 启动横幅 │ │ ├── tagline.json # 有趣标语 │ │ └── help.json # 帮助信息 │ ├── wizard/ # 向导翻译 │ │ ├── onboarding.json # 初始化向导 │ │ ├── security.json # 安全警告 │ │ └── finalize.json # 完成提示 │ ├── tui/ # TUI 界面翻译 │ │ ├── waiting.json # 等待动画 │ │ └── commands.json # 斜杠命令 │ ├── commands/ # 命令翻译 │ │ ├── status.json # status 命令 │ │ ├── update.json # update 命令 │ │ ├── skills.json # skills 命令 │ │ └── ... # 更多命令 │ ├── dashboard/ # Dashboard UI 翻译 (20+ 文件) │ │ ├── navigation.json # 导航菜单 │ │ ├── app-render.json # 主布局 │ │ ├── chat.json # 聊天界面 │ │ ├── agents.json # 代理管理 │ │ ├── config.json # 配置页面 │ │ ├── schema.json # 配置 schema (300+ 标签) │ │ ├── channels-*.json # 各渠道翻译 │ │ └── ... # 更多模块 │ └── panel/ # 功能面板(注入到 Dashboard) │ ├── feature-panel.js │ ├── feature-panel.css │ └── panel-data.json ├── scripts/ # 构建脚本 │ ├── inject_panel.py # 功能面板注入 │ └── inject_remote.py # 远程注入 ├── docs/ # 文档 ├── tests/ # 测试 ├── .github/workflows/ # CI/CD 工作流 ├── install.sh # Linux/macOS 安装脚本 ├── install.ps1 # Windows 安装脚本 ├── docker-deploy.sh # Docker 一键部署 └── docker-deploy.ps1 # Docker 一键部署 (Windows) ``` --- ## 汉化 CLI 工具 | 命令 | 说明 | |------|------| | `npm run cli -- status` | 查看当前汉化状态 | | `npm run cli -- apply` | 应用汉化补丁 | | `npm run cli -- apply --dry-run` | 预览汉化(不实际修改) | | `npm run cli -- apply --verbose` | 详细输出汉化过程 | | `npm run cli -- apply --target=../openclaw` | 指定目标目录 | | `npm run cli -- verify` | 验证汉化结果 | | `npm run cli -- restore` | 恢复原版(使用 git checkout) | --- ## 手动汉化安装 适用于想要自定义翻译、测试最新代码或参与贡献的用户: ```bash # 1. 克隆汉化项目 git clone https://github.com/1186258278/OpenClawChineseTranslation.git cd OpenClawChineseTranslation # 2. 克隆上游 OpenClaw 源码 git clone https://github.com/openclaw/openclaw.git openclaw # 3. 查看汉化状态 npm run cli -- status # 4. 应用汉化补丁 npm run cli -- apply # 5. 验证汉化结果 npm run cli -- verify # 6. 构建 OpenClaw cd openclaw pnpm install pnpm run build # 7. 全局安装 npm install -g . # 8. 验证安装 openclaw --version openclaw --help ``` --- ## 添加新翻译 ### 1. 找到目标文件 确定需要翻译的源文件位置(在 `openclaw/` 目录中)。 ### 2. 创建翻译规则 在 `translations/` 对应目录创建或编辑 JSON 文件: ```json { "file": "src/path/to/file.ts", "description": "文件说明", "replacements": { "\"English Text\"": "\"中文翻译\"", "