Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions CHINESE_LOCALIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# 中文本地化说明 (Chinese Localization)

## 概述

本项目为 opcode 添加了完整的中文本地化支持,让中文用户能够更方便地使用这个强大的 Claude Code GUI 工具。

## 功能特性

### 🌐 双语支持
- **英文** (English) - 默认语言
- **中文** (Chinese) - 完整汉化

### 📦 新增内容

1. **国际化架构**
- 使用 `react-i18next` 和 `i18next` 实现
- 支持动态语言切换
- 自动检测系统语言

2. **汉化组件**
- 欢迎页面 (`Welcome`)
- 项目列表 (`ProjectList`)
- 设置页面 (`Settings`)
- 标题栏 (`CustomTitlebar`)
- 所有 UI 组件和提示信息

3. **语言文件**
- `src/i18n/locales/en.json` - 英文翻译
- `src/i18n/locales/zh.json` - 中文翻译

4. **语言选择器**
- 在设置页面添加语言切换功能
- 支持实时切换,无需重启应用
- 自动保存语言偏好

## 安装使用

### 方式一:直接运行
```bash
# 下载后双击运行
opcode.exe
```

### 方式二:安装版
```bash
# MSI 安装包(推荐)
opcode_0.2.0_x64_en-US.msi

# 或 NSIS 安装包
opcode_0.2.0_x64-setup.exe
```

## 切换语言

1. 打开应用后点击右上角的 **⚙️ 设置** 按钮
2. 在"常规"标签页找到"语言"选项
3. 选择"中文"或"English"
4. 设置会自动保存并立即生效

## 构建说明

### 环境要求
- Node.js 18+
- Rust 1.70+
- Windows 10/11

### 构建步骤

```bash
# 1. 安装依赖
npm install

# 2. 构建前端
npm run build

# 3. 构建 Windows 应用
npm run tauri build
```

### 输出文件
构建完成后,文件位于:
- `src-tauri/target/release/opcode.exe` - 可执行文件
- `src-tauri/target/release/bundle/msi/` - MSI 安装包
- `src-tauri/target/release/bundle/nsis/` - NSIS 安装包

## 技术细节

### 依赖项
```json
{
"i18next": "^26.0.4",
"react-i18next": "^17.0.2"
}
```

### 文件结构
```
src/
├── i18n/
│ ├── index.ts # i18n 配置
│ └── locales/
│ ├── en.json # 英文翻译
│ └── zh.json # 中文翻译
├── components/
│ ├── LanguageSelector.tsx # 语言选择器组件
│ └── ... # 其他已汉化组件
```

### 配置修改

1. **tauri.conf.json** - 添加 Windows 构建目标
```json
{
"bundle": {
"targets": ["msi", "nsis"]
}
}
```

2. **package.json** - 添加 i18n 依赖
```json
{
"dependencies": {
"i18next": "^26.0.4",
"react-i18next": "^17.0.2"
}
}
```

## 贡献指南

如果你想改进中文翻译:

1. 编辑 `src/i18n/locales/zh.json`
2. 遵循 JSON 格式规范
3. 保持键名与英文版本一致
4. 提交 Pull Request

## 致谢

- 原作者:[getAsterisk](https://github.com/getAsterisk)
- 原项目:[opcode](https://github.com/getAsterisk/opcode)
- 本地化贡献者:社区开发者

## 许可证

与原项目保持一致:AGPL-3.0

## 更新日志

### v0.2.0 (2026-04-09)
- ✅ 添加完整中文本地化支持
- ✅ 实现语言切换功能
- ✅ 汉化所有 UI 组件
- ✅ 添加 Windows 安装包构建
- ✅ 优化中文显示效果

## 联系方式

如有问题或建议,欢迎提交 Issue 或 Pull Request。

---

**注意**:本项目基于 opcode 原版进行本地化,所有版权归原作者所有。
204 changes: 204 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# opcode - 中文本地化版

[![GitHub stars](https://img.shields.io/github/stars/getAsterisk/opcode)](https://github.com/getAsterisk/opcode)
[![License](https://img.shields.io/badge/license-AGPL--3.0-blue)](LICENSE)
[![中文](https://img.shields.io/badge/语言-中文-red)](README_CN.md)

> 🌐 **中文本地化版本** | [English](README.md)

一个强大的 Claude Code GUI 应用程序和工具包,现已支持中文界面!

![opcode 界面预览](https://github.com/getAsterisk/opcode/raw/main/.github/assets/screenshot.png)

## ✨ 功能特性

### 🗂️ 项目与会话管理
- 📁 可视化项目浏览器
- 📝 会话历史记录
- 🔍 智能搜索功能
- 📊 会话元数据查看

### 🤖 CC 代理系统
- 🎯 自定义 AI 代理
- 📚 代理库管理
- ⚡ 后台执行
- 📈 执行历史追踪

### 📊 使用分析仪表板
- 💰 成本追踪
- 🔢 令牌分析
- 📉 可视化图表
- 📤 数据导出

### 🔌 MCP 服务器管理
- 🖥️ 服务器注册表
- ⚙️ 简单配置
- 🔗 连接测试
- 📥 配置导入

### ⏰ 时间线与检查点
- 🔄 会话版本控制
- 🌳 可视化时间线
- ⏪ 即时恢复
- 🌿 会话分支

### 🌐 中文本地化
- ✅ 完整中文界面
- 🔄 双语切换
- 📝 中文文档
- 🎨 优化中文显示

## 🚀 快速开始

### 下载安装

#### 方式一:MSI 安装包(推荐)
```bash
# 下载并运行
opcode_0.2.0_x64_en-US.msi
```

#### 方式二:便携版
```bash
# 下载后直接运行
opcode.exe
```

### 切换中文

1. 打开应用
2. 点击右上角 ⚙️ **设置**
3. 选择"常规" → "语言"
4. 选择"中文"
5. 设置自动保存

### 配置 Claude Code

1. 确保已安装 [Claude Code CLI](https://claude.ai/code)
2. 在设置中配置 API 密钥
3. 开始使用!

## 📖 使用指南

### 项目管理
```
项目 → 选择项目 → 查看会话 → 恢复或新建
```

### 创建代理
```
代理 → 创建代理 → 配置 → 执行
```

### 查看使用情况
```
菜单 → 使用情况 → 查看分析
```

## 🛠️ 从源码构建

### 环境要求
- Node.js 18+
- Rust 1.70+
- Windows 10/11

### 构建步骤

```bash
# 1. 克隆仓库
git clone https://github.com/getAsterisk/opcode.git
cd opcode

# 2. 安装依赖
npm install

# 3. 构建前端
npm run build

# 4. 构建 Windows 应用
npm run tauri build
```

### 输出文件
- `src-tauri/target/release/opcode.exe` - 可执行文件
- `src-tauri/target/release/bundle/msi/` - MSI 安装包
- `src-tauri/target/release/bundle/nsis/` - NSIS 安装包

## 📁 项目结构

```
opcode/
├── src/ # React 前端
│ ├── components/ # UI 组件
│ ├── i18n/ # 国际化文件
│ │ ├── locales/
│ │ │ ├── en.json # 英文翻译
│ │ │ └── zh.json # 中文翻译
│ └── lib/ # 工具库
├── src-tauri/ # Rust 后端
│ └── src/
└── cc_agents/ # 代理配置
```

## 🌐 国际化

本项目使用 `react-i18next` 实现国际化支持。

### 添加新语言

1. 在 `src/i18n/locales/` 创建新的 JSON 文件
2. 复制 `en.json` 的内容并翻译
3. 在 `src/i18n/index.ts` 中导入新语言

### 翻译文件示例

```json
{
"welcome": {
"title": "欢迎使用 opcode",
"projects": "项目"
}
}
```

## 🤝 贡献

欢迎提交 Issue 和 Pull Request!

### 贡献步骤

1. Fork 本仓库
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 创建 Pull Request

## 📄 许可证

本项目采用 AGPL-3.0 许可证 - 详见 [LICENSE](LICENSE) 文件

## 🙏 致谢

- 原作者:[getAsterisk](https://github.com/getAsterisk)
- 原项目:[opcode](https://github.com/getAsterisk/opcode)
- Claude Code by [Anthropic](https://www.anthropic.com/)

## 📞 联系方式

- GitHub Issues: [提交问题](https://github.com/getAsterisk/opcode/issues)
- 原项目地址:https://github.com/getAsterisk/opcode

## 📝 更新日志

### v0.2.0 (2026-04-09)
- ✅ 添加完整中文本地化支持
- ✅ 实现语言切换功能
- ✅ 汉化所有 UI 组件
- ✅ 添加 Windows 安装包
- ✅ 优化中文显示效果

---

**注意**:本项目基于 opcode 原版进行本地化,所有版权归原作者所有。

**免责声明**:本项目与 Anthropic 无关,Claude 是 Anthropic 的商标。
Loading