opencode-cn 1.2.10 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,225 +1,239 @@
1
- # OpenCode 中文翻译插件
2
-
3
- OpenCode 的中文本地化插件,为已安装的 OpenCode 提供中文界面支持。
4
- 后续几天会更新一键安装包,方便大家使用
5
- ## 功能特点
6
-
7
- - 模块化翻译配置,易于维护
8
- - 自动检测 OpenCode 安装路径
9
- - **版本匹配检测** - 自动检测 OpenCode 版本是否与翻译插件兼容
10
- - **自动安装 OpenCode** - 未安装时可自动克隆并安装
11
- - **升级支持** - 支持升级 OpenCode 并重新应用翻译
12
- - 精确文件定位,避免误替换
13
-
14
- ## 前置要求
15
-
16
- - [Node.js](https://nodejs.org/) >= 18.0.0
17
- - [Bun](https://bun.sh/)(安装脚本会自动安装)
18
- - [Git](https://git-scm.com/)
19
-
20
- ## 安装
21
-
22
- ### 方式一:NPM 安装(推荐)
23
-
24
- ```bash
25
- npm install -g opencode-cn
26
- ```
27
-
28
- ### 方式二:Bun 安装
29
-
30
- ```bash
31
- bun install -g opencode-cn
32
- ```
33
-
34
- ### 方式三:手动安装
35
-
36
- ```bash
37
- # 克隆仓库
38
- git clone https://github.com/huangzejian365/opencode-cn.git
39
- cd opencode-cn
40
-
41
- # 安装依赖
42
- npm install
43
- ```
44
-
45
- ## 使用方法
46
-
47
- ### 完整流程(推荐)
48
-
49
- ```bash
50
- # 1. 自动安装 OpenCode(如果未安装)
51
- opencode-cn-localize --install
52
-
53
- # 2. 翻译并构建(一步完成)
54
- opencode-cn-localize
55
- ```
56
-
57
- ### 命令参数
58
-
59
- | 参数 | 说明 |
60
- |------|------|
61
- | `--install` | 自动安装 OpenCode 到 `~/.opencode-cn/opencode` |
62
- | `--upgrade` | 升级 OpenCode 到最新版本 |
63
- | `--no-build` | 仅翻译不构建 |
64
-
65
- ### 示例
66
-
67
- ```bash
68
- # 自动安装 OpenCode
69
- opencode-cn-localize --install
70
-
71
- # 翻译并构建(默认)
72
- opencode-cn-localize
73
-
74
- # 仅翻译不构建
75
- opencode-cn-localize --no-build
76
-
77
- # 升级 OpenCode
78
- opencode-cn-localize --upgrade
79
-
80
- # 升级后重新翻译
81
- opencode-cn-localize
82
- ```
83
-
84
- ## 版本匹配
85
-
86
- 运行翻译插件时,会自动检测 OpenCode 版本是否与翻译插件支持的版本匹配:
87
-
88
- ```
89
- OpenCode version: 1.2.10
90
- Translation config version: 1.2.10
91
- 版本匹配!OpenCode: 1.2.10
92
- ```
93
-
94
- 如果版本不匹配,会显示警告但不会阻止执行:
95
-
96
- ```
97
- ⚠ 版本不匹配!
98
- OpenCode: 1.2.11
99
- 翻译插件: 1.2.10
100
- 可能存在未翻译的内容
101
- ```
102
-
103
- ## 升级流程
104
-
105
- OpenCode 发布新版本时:
106
-
107
- ```bash
108
- # 1. 升级 OpenCode 源码
109
- opencode-cn-localize --upgrade
110
-
111
- # 2. 重新翻译并构建
112
- opencode-cn-localize
113
- ```
114
-
115
- > **注意**:升级后如果版本不匹配,可能存在未翻译的新内容。请关注翻译插件更新。
116
-
117
- ### 环境变量
118
-
119
- | 变量 | 说明 | 默认值 |
120
- |------|------|--------|
121
- | `OPENCODE_SOURCE_DIR` | OpenCode 源码目录 | 自动检测 |
122
-
123
- ### 自动检测路径顺序
124
-
125
- 1. `OPENCODE_SOURCE_DIR` 环境变量
126
- 2. `~/.opencode-cn/opencode`
127
- 3. `/root/opencode/packages/opencode`
128
- 4. `~/opencode/packages/opencode`
129
- 5. `~/.opencode/opencode/packages/opencode`
130
-
131
- ## 项目结构
132
-
133
- ```
134
- opencode-cn/
135
- ├── translations/
136
- │ ├── config.json # 主配置文件
137
- │ ├── app.json # 应用主入口
138
- │ ├── dialogs/ # 对话框组件
139
- │ ├── components/ # UI 组件
140
- │ ├── routes/ # 路由页面
141
- │ └── common/ # 通用消息
142
- ├── localize.ts # 翻译脚本
143
- ├── tsconfig.json
144
- └── package.json
145
- ```
146
-
147
- ## 翻译配置格式
148
-
149
- 每个翻译文件包含以下结构:
150
-
151
- ```json
152
- {
153
- "file": "src/cli/cmd/tui/component/dialog-provider.tsx",
154
- "description": "提供商连接对话框",
155
- "replacements": {
156
- "title=\"Select auth method\"": "title=\"选择认证方式\"",
157
- "placeholder=\"API key\"": "placeholder=\"API密钥\""
158
- }
159
- }
160
- ```
161
-
162
- ## 贡献翻译
163
-
164
- 1. Fork 本仓库
165
- 2. 在 `translations/` 目录下创建或编辑翻译文件
166
- 3. 更新 `translations/config.json` 中的版本号
167
- 4. 运行 `bun run localize.ts` 测试
168
- 5. 提交 Pull Request
169
-
170
- ## 常见问题
171
-
172
- ### Q: 翻译后部分内容仍显示英文?
173
-
174
- A: 可能是:
175
- 1. 新增内容尚未翻译 - 可以提交 Issue 报告
176
- 2. 版本不匹配 - 检查 `translations/config.json` 中的版本是否与 OpenCode 一致
177
-
178
- ### Q: 如何恢复英文版?
179
-
180
- A: 重新克隆或更新 OpenCode 源码:
181
- ```bash
182
- rm -rf ~/.opencode-cn/opencode
183
- opencode-cn-localize --install
184
- ```
185
-
186
- ### Q: 翻译脚本找不到 OpenCode?
187
-
188
- A: 设置环境变量指定路径:
189
- ```bash
190
- OPENCODE_SOURCE_DIR=/path/to/opencode opencode-cn-localize
191
- ```
192
-
193
- ### Q: 升级后翻译丢失?
194
-
195
- A: 升级会重置源码,需要重新运行翻译:
196
- ```bash
197
- opencode-cn-localize --upgrade
198
- opencode-cn-localize
199
- ```
200
-
201
- ### Q: 支持哪些平台?
202
-
203
- A: 支持 Linux (x64, arm64)、macOS (x64, arm64)、Windows (x64)
204
-
205
- ## 开发
206
-
207
- ```bash
208
- # 克隆仓库
209
- git clone https://github.com/huangzejian365/opencode-cn.git
210
- cd opencode-cn
211
-
212
- # 安装依赖
213
- npm install
214
-
215
- # 运行翻译脚本
216
- OPENCODE_SOURCE_DIR=/path/to/opencode bun run localize.ts
217
- ```
218
-
219
- ## 许可证
220
-
221
- MIT License
222
-
223
- ## 致谢
224
-
225
- - [OpenCode](https://github.com/anomalyco/opencode) - 原始项目
1
+ # OpenCode 中文翻译插件
2
+
3
+ OpenCode 的中文本地化插件,为已安装的 OpenCode 提供中文界面支持。
4
+ 后续几天会更新一键安装包,方便大家使用
5
+ ## 功能特点
6
+
7
+ - 模块化翻译配置,易于维护
8
+ - 自动检测 OpenCode 安装路径
9
+ - **版本匹配检测** - 自动检测 OpenCode 版本是否与翻译插件兼容
10
+ - **自动安装 OpenCode** - 未安装时可自动克隆并安装
11
+ - **升级支持** - 支持升级 OpenCode 并重新应用翻译
12
+ - 精确文件定位,避免误替换
13
+
14
+ ## 前置要求
15
+
16
+ - [Node.js](https://nodejs.org/) >= 18.0.0
17
+ - [Bun](https://bun.sh/)(安装脚本会自动安装)
18
+ - [Git](https://git-scm.com/)
19
+
20
+ ## 快速开始(两步完成)
21
+
22
+ ### 第1步:安装本翻译工具
23
+
24
+ ```bash
25
+ # 使用 NPM 安装
26
+ npm install -g opencode-cn
27
+
28
+ # 或使用 Bun 安装
29
+ bun install -g opencode-cn
30
+ ```
31
+
32
+ > ⚠️ **注意**:这只是安装了中文翻译工具,还没有安装 OpenCode 本体。
33
+
34
+ ### 第2步:安装并汉化 OpenCode
35
+
36
+ ```bash
37
+ # 一键完成:下载 OpenCode + 应用中文翻译 + 构建
38
+ opencode-cn-localize --install
39
+ ```
40
+
41
+ 安装完成后,直接运行:
42
+ ```bash
43
+ opencode # 启动已汉化的 OpenCode
44
+ ```
45
+
46
+ ## 安装方式对比
47
+
48
+ | 方式 | 命令 | 说明 |
49
+ |------|------|------|
50
+ | **NPM**(推荐) | `npm install -g opencode-cn` | 最简单,自动管理依赖 |
51
+ | **Bun** | `bun install -g opencode-cn` | 速度快,需先安装 Bun |
52
+ | **手动** | `git clone` + `npm install` | 适合开发贡献 |
53
+
54
+ ## 使用方法
55
+
56
+ ### 首次安装(完整流程)
57
+
58
+ ```bash
59
+ # 1. 安装翻译工具(见上文第1步)
60
+ npm install -g opencode-cn
61
+
62
+ # 2. 自动安装 OpenCode 并应用中文翻译
63
+ opencode-cn-localize --install
64
+
65
+ # 3. 启动 OpenCode
66
+ opencode
67
+ ```
68
+
69
+ ### 日常命令
70
+
71
+ ### 命令参数
72
+
73
+ | 参数 | 说明 |
74
+ |------|------|
75
+ | `--install` | 自动安装 OpenCode 到 `~/.opencode-cn/opencode` |
76
+ | `--upgrade` | 升级 OpenCode 到最新版本 |
77
+ | `--no-build` | 仅翻译不构建 |
78
+
79
+ ### 示例
80
+
81
+ ```bash
82
+ # 自动安装 OpenCode
83
+ opencode-cn-localize --install
84
+
85
+ # 翻译并构建(默认)
86
+ opencode-cn-localize
87
+
88
+ # 仅翻译不构建
89
+ opencode-cn-localize --no-build
90
+
91
+ # 升级 OpenCode
92
+ opencode-cn-localize --upgrade
93
+
94
+ # 升级后重新翻译
95
+ opencode-cn-localize
96
+ ```
97
+
98
+ ## 版本匹配
99
+
100
+ 运行翻译插件时,会自动检测 OpenCode 版本是否与翻译插件支持的版本匹配:
101
+
102
+ ```
103
+ OpenCode version: 1.2.10
104
+ Translation config version: 1.2.10
105
+ 版本匹配!OpenCode: 1.2.10
106
+ ```
107
+
108
+ 如果版本不匹配,会显示警告但不会阻止执行:
109
+
110
+ ```
111
+ 版本不匹配!
112
+ OpenCode: 1.2.11
113
+ 翻译插件: 1.2.10
114
+ 可能存在未翻译的内容
115
+ ```
116
+
117
+ ## 升级流程
118
+
119
+ OpenCode 发布新版本时:
120
+
121
+ ```bash
122
+ # 1. 升级 OpenCode 源码
123
+ opencode-cn-localize --upgrade
124
+
125
+ # 2. 重新翻译并构建
126
+ opencode-cn-localize
127
+ ```
128
+
129
+ > **注意**:升级后如果版本不匹配,可能存在未翻译的新内容。请关注翻译插件更新。
130
+
131
+ ### 环境变量
132
+
133
+ | 变量 | 说明 | 默认值 |
134
+ |------|------|--------|
135
+ | `OPENCODE_SOURCE_DIR` | OpenCode 源码目录 | 自动检测 |
136
+
137
+ ### 自动检测路径顺序
138
+
139
+ 1. `OPENCODE_SOURCE_DIR` 环境变量
140
+ 2. `~/.opencode-cn/opencode`
141
+ 3. `/root/opencode/packages/opencode`
142
+ 4. `~/opencode/packages/opencode`
143
+ 5. `~/.opencode/opencode/packages/opencode`
144
+
145
+ ## 项目结构
146
+
147
+ ```
148
+ opencode-cn/
149
+ ├── translations/
150
+ │ ├── config.json # 主配置文件
151
+ │ ├── app.json # 应用主入口
152
+ │ ├── dialogs/ # 对话框组件
153
+ │ ├── components/ # UI 组件
154
+ │ ├── routes/ # 路由页面
155
+ │ └── common/ # 通用消息
156
+ ├── localize.ts # 翻译脚本
157
+ ├── tsconfig.json
158
+ └── package.json
159
+ ```
160
+
161
+ ## 翻译配置格式
162
+
163
+ 每个翻译文件包含以下结构:
164
+
165
+ ```json
166
+ {
167
+ "file": "src/cli/cmd/tui/component/dialog-provider.tsx",
168
+ "description": "提供商连接对话框",
169
+ "replacements": {
170
+ "title=\"Select auth method\"": "title=\"选择认证方式\"",
171
+ "placeholder=\"API key\"": "placeholder=\"API密钥\""
172
+ }
173
+ }
174
+ ```
175
+
176
+ ## 贡献翻译
177
+
178
+ 1. Fork 本仓库
179
+ 2. 在 `translations/` 目录下创建或编辑翻译文件
180
+ 3. 更新 `translations/config.json` 中的版本号
181
+ 4. 运行 `bun run localize.ts` 测试
182
+ 5. 提交 Pull Request
183
+
184
+ ## 常见问题
185
+
186
+ ### Q: 翻译后部分内容仍显示英文?
187
+
188
+ A: 可能是:
189
+ 1. 新增内容尚未翻译 - 可以提交 Issue 报告
190
+ 2. 版本不匹配 - 检查 `translations/config.json` 中的版本是否与 OpenCode 一致
191
+
192
+ ### Q: 如何恢复英文版?
193
+
194
+ A: 重新克隆或更新 OpenCode 源码:
195
+ ```bash
196
+ rm -rf ~/.opencode-cn/opencode
197
+ opencode-cn-localize --install
198
+ ```
199
+
200
+ ### Q: 翻译脚本找不到 OpenCode?
201
+
202
+ A: 设置环境变量指定路径:
203
+ ```bash
204
+ OPENCODE_SOURCE_DIR=/path/to/opencode opencode-cn-localize
205
+ ```
206
+
207
+ ### Q: 升级后翻译丢失?
208
+
209
+ A: 升级会重置源码,需要重新运行翻译:
210
+ ```bash
211
+ opencode-cn-localize --upgrade
212
+ opencode-cn-localize
213
+ ```
214
+
215
+ ### Q: 支持哪些平台?
216
+
217
+ A: 支持 Linux (x64, arm64)、macOS (x64, arm64)、Windows (x64)
218
+
219
+ ## 开发
220
+
221
+ ```bash
222
+ # 克隆仓库
223
+ git clone https://github.com/huangzejian365/opencode-cn.git
224
+ cd opencode-cn
225
+
226
+ # 安装依赖
227
+ npm install
228
+
229
+ # 运行翻译脚本
230
+ OPENCODE_SOURCE_DIR=/path/to/opencode bun run localize.ts
231
+ ```
232
+
233
+ ## 许可证
234
+
235
+ MIT License
236
+
237
+ ## 致谢
238
+
239
+ - [OpenCode](https://github.com/anomalyco/opencode) - 原始项目
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "opencode-cn",
3
- "version": "1.2.10",
4
- "description": "OpenCode 中文翻译插件 - OpenCode Chinese Localization Plugin",
5
- "main": "dist/localize.js",
6
- "bin": {
7
- "opencode-cn-localize": "dist/localize.js"
8
- },
9
- "scripts": {
10
- "build": "tsc",
11
- "localize": "bun run localize.ts",
12
- "prepublishOnly": "npm run build"
13
- },
14
- "keywords": [
15
- "opencode",
16
- "chinese",
17
- "localization",
18
- "i18n",
19
- "ai",
20
- "coding",
21
- "assistant",
22
- "cli",
23
- "tui"
24
- ],
25
- "author": "opencode-cn",
26
- "license": "MIT",
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/huangzejian365/opencode-cn"
30
- },
31
- "homepage": "https://github.com/huangzejian365/opencode-cn#readme",
32
- "bugs": {
33
- "url": "https://github.com/huangzejian365/opencode-cn/issues"
34
- },
35
- "engines": {
36
- "node": ">=18.0.0"
37
- },
38
- "publishConfig": {
39
- "access": "public",
40
- "registry": "https://registry.npmjs.org/"
41
- },
42
- "files": [
43
- "dist/",
44
- "translations/",
45
- "README.md"
46
- ],
47
- "devDependencies": {
48
- "@types/node": "^25.3.0",
49
- "typescript": "^5.9.3"
50
- },
51
- "os": [
52
- "linux",
53
- "darwin",
54
- "win32"
55
- ]
56
- }
1
+ {
2
+ "name": "opencode-cn",
3
+ "version": "1.2.11",
4
+ "description": "OpenCode 中文翻译插件 - OpenCode Chinese Localization Plugin",
5
+ "main": "dist/localize.js",
6
+ "bin": {
7
+ "opencode-cn-localize": "dist/localize.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "localize": "bun run localize.ts",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "keywords": [
15
+ "opencode",
16
+ "chinese",
17
+ "localization",
18
+ "i18n",
19
+ "ai",
20
+ "coding",
21
+ "assistant",
22
+ "cli",
23
+ "tui"
24
+ ],
25
+ "author": "opencode-cn",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/huangzejian365/opencode-cn.git"
30
+ },
31
+ "homepage": "https://github.com/huangzejian365/opencode-cn#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/huangzejian365/opencode-cn/issues"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "registry": "https://registry.npmjs.org/"
41
+ },
42
+ "files": [
43
+ "dist/",
44
+ "translations/",
45
+ "README.md"
46
+ ],
47
+ "devDependencies": {
48
+ "@types/node": "^25.3.0",
49
+ "typescript": "^5.9.3"
50
+ },
51
+ "os": [
52
+ "linux",
53
+ "darwin",
54
+ "win32"
55
+ ]
56
+ }
@@ -1,46 +1,46 @@
1
- {
2
- "file": "src/cli/cmd/tui/app.tsx",
3
- "description": "应用主入口 - 命令和系统设置",
4
- "replacements": {
5
- "title: \"Switch session\"": "title: \"切换会话\"",
6
- "title: \"New session\"": "title: \"新建会话\"",
7
- "title: \"Switch model\"": "title: \"切换模型\"",
8
- "title: \"Model cycle\"": "title: \"模型切换\"",
9
- "title: \"Model cycle reverse\"": "title: \"模型切换(反向)\"",
10
- "title: \"Favorite cycle\"": "title: \"收藏切换\"",
11
- "title: \"Favorite cycle reverse\"": "title: \"收藏切换(反向)\"",
12
- "title: \"Switch agent\"": "title: \"切换代理\"",
13
- "title: \"Toggle MCPs\"": "title: \"切换MCP\"",
14
- "title: \"Agent cycle\"": "title: \"代理切换\"",
15
- "title: \"Agent cycle reverse\"": "title: \"代理切换(反向)\"",
16
- "title: \"Variant cycle\"": "title: \"变体切换\"",
17
- "title: \"Connect provider\"": "title: \"连接提供商\"",
18
- "title: \"View status\"": "title: \"查看状态\"",
19
- "title: \"Switch theme\"": "title: \"切换主题\"",
20
- "title: \"Toggle appearance\"": "title: \"切换外观\"",
21
- "title: \"Help\"": "title: \"帮助\"",
22
- "title: \"Open docs\"": "title: \"打开文档\"",
23
- "title: \"Exit the app\"": "title: \"退出应用\"",
24
- "title: \"Toggle debug panel\"": "title: \"切换调试面板\"",
25
- "title: \"Toggle console\"": "title: \"切换控制台\"",
26
- "title: \"Write heap snapshot\"": "title: \"写入堆快照\"",
27
- "title: \"Suspend terminal\"": "title: \"挂起终端\"",
28
- "title: \"Disable terminal title\"": "title: \"禁用终端标题\"",
29
- "title: \"Enable terminal title\"": "title: \"启用终端标题\"",
30
- "title: \"Disable animations\"": "title: \"禁用动画\"",
31
- "title: \"Enable animations\"": "title: \"启用动画\"",
32
- "title: \"Disable diff wrapping\"": "title: \"禁用差异换行\"",
33
- "title: \"Enable diff wrapping\"": "title: \"启用差异换行\"",
34
- "message: \"Copied to clipboard\"": "message: \"已复制到剪贴板\"",
35
- "message: \"Failed to fork session\"": "message: \"无法分叉会话\"",
36
- "message: \"The current session was deleted\"": "message: \"当前会话已删除\"",
37
- "message: \"An error occurred\"": "message: \"发生错误\"",
38
- "title: \"Update Available\"": "title: \"有更新可用\"",
39
- "message: \"Successfully copied\"": "message: \"复制成功\"",
40
- "message: \"Reset TUI\"": "message: \"重置TUI\"",
41
- "message: \"Exit\"": "message: \"退出\"",
42
- "message: \"A fatal error occurred!\"": "message: \"发生致命错误!\"",
43
- "message: \"Please report an issue.\"": "message: \"请报告问题。\"",
44
- "message: \"Copy issue URL (exception info pre-filled)\"": "message: \"复制问题URL(异常信息已预填)\""
45
- }
46
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/app.tsx",
3
+ "description": "应用主入口 - 命令和系统设置",
4
+ "replacements": {
5
+ "title: \"Switch session\"": "title: \"切换会话\"",
6
+ "title: \"New session\"": "title: \"新建会话\"",
7
+ "title: \"Switch model\"": "title: \"切换模型\"",
8
+ "title: \"Model cycle\"": "title: \"模型切换\"",
9
+ "title: \"Model cycle reverse\"": "title: \"模型切换(反向)\"",
10
+ "title: \"Favorite cycle\"": "title: \"收藏切换\"",
11
+ "title: \"Favorite cycle reverse\"": "title: \"收藏切换(反向)\"",
12
+ "title: \"Switch agent\"": "title: \"切换代理\"",
13
+ "title: \"Toggle MCPs\"": "title: \"切换MCP\"",
14
+ "title: \"Agent cycle\"": "title: \"代理切换\"",
15
+ "title: \"Agent cycle reverse\"": "title: \"代理切换(反向)\"",
16
+ "title: \"Variant cycle\"": "title: \"变体切换\"",
17
+ "title: \"Connect provider\"": "title: \"连接提供商\"",
18
+ "title: \"View status\"": "title: \"查看状态\"",
19
+ "title: \"Switch theme\"": "title: \"切换主题\"",
20
+ "title: \"Toggle appearance\"": "title: \"切换外观\"",
21
+ "title: \"Help\"": "title: \"帮助\"",
22
+ "title: \"Open docs\"": "title: \"打开文档\"",
23
+ "title: \"Exit the app\"": "title: \"退出应用\"",
24
+ "title: \"Toggle debug panel\"": "title: \"切换调试面板\"",
25
+ "title: \"Toggle console\"": "title: \"切换控制台\"",
26
+ "title: \"Write heap snapshot\"": "title: \"写入堆快照\"",
27
+ "title: \"Suspend terminal\"": "title: \"挂起终端\"",
28
+ "title: \"Disable terminal title\"": "title: \"禁用终端标题\"",
29
+ "title: \"Enable terminal title\"": "title: \"启用终端标题\"",
30
+ "title: \"Disable animations\"": "title: \"禁用动画\"",
31
+ "title: \"Enable animations\"": "title: \"启用动画\"",
32
+ "title: \"Disable diff wrapping\"": "title: \"禁用差异换行\"",
33
+ "title: \"Enable diff wrapping\"": "title: \"启用差异换行\"",
34
+ "message: \"Copied to clipboard\"": "message: \"已复制到剪贴板\"",
35
+ "message: \"Failed to fork session\"": "message: \"无法分叉会话\"",
36
+ "message: \"The current session was deleted\"": "message: \"当前会话已删除\"",
37
+ "message: \"An error occurred\"": "message: \"发生错误\"",
38
+ "title: \"Update Available\"": "title: \"有更新可用\"",
39
+ "message: \"Successfully copied\"": "message: \"复制成功\"",
40
+ "message: \"Reset TUI\"": "message: \"重置TUI\"",
41
+ "message: \"Exit\"": "message: \"退出\"",
42
+ "message: \"A fatal error occurred!\"": "message: \"发生致命错误!\"",
43
+ "message: \"Please report an issue.\"": "message: \"请报告问题。\"",
44
+ "message: \"Copy issue URL (exception info pre-filled)\"": "message: \"复制问题URL(异常信息已预填)\""
45
+ }
46
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "description": "通用应用消息 - 这些翻译已整合到各组件文件中",
3
- "replacements": {}
4
- }
1
+ {
2
+ "description": "通用应用消息 - 这些翻译已整合到各组件文件中",
3
+ "replacements": {}
4
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "description": "错误消息 - 这些翻译已整合到各组件文件中",
3
- "replacements": {}
4
- }
1
+ {
2
+ "description": "错误消息 - 这些翻译已整合到各组件文件中",
3
+ "replacements": {}
4
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "description": "Toast消息 - 这些翻译已整合到各组件文件中",
3
- "replacements": {}
4
- }
1
+ {
2
+ "description": "Toast消息 - 这些翻译已整合到各组件文件中",
3
+ "replacements": {}
4
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/prompt/autocomplete.tsx",
3
- "description": "自动完成组件",
4
- "replacements": {
5
- "<text fg={theme.textMuted}>No matching items</text>": "<text fg={theme.textMuted}>无匹配项</text>"
6
- }
7
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/prompt/autocomplete.tsx",
3
+ "description": "自动完成组件",
4
+ "replacements": {
5
+ "<text fg={theme.textMuted}>No matching items</text>": "<text fg={theme.textMuted}>无匹配项</text>"
6
+ }
7
+ }
@@ -1,23 +1,23 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/prompt/index.tsx",
3
- "description": "提示输入组件",
4
- "replacements": {
5
- "title: \"Clear prompt\"": "title: \"清空提示\"",
6
- "title: \"Submit prompt\"": "title: \"提交提示\"",
7
- "title: \"Paste\"": "title: \"粘贴\"",
8
- "title: \"Interrupt session\"": "title: \"中断会话\"",
9
- "title: \"Open editor\"": "title: \"打开编辑器\"",
10
- "title: \"Skills\"": "title: \"技能\"",
11
- "title: \"Stash prompt\"": "title: \"暂存提示\"",
12
- "title: \"Stash pop\"": "title: \"弹出暂存\"",
13
- "title: \"Stash list\"": "title: \"暂存列表\"",
14
- "message: \"Connect a provider to send prompts\"": "message: \"连接提供商以发送提示\"",
15
- "return `Ask anything...": "return `询问任何问题...",
16
- "return `Run a command...": "return `运行命令...",
17
- "\"interrupt\"": "\"中断\"",
18
- "\"again to interrupt\"": "\"再次中断\"",
19
- "\"exit shell mode\"": "\"退出终端模式\"",
20
- "\"gemini is way too hot right now\"": "\"Gemini现在太火爆了\"",
21
- "\" (click to expand)\"": "\" (点击展开)\""
22
- }
23
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/prompt/index.tsx",
3
+ "description": "提示输入组件",
4
+ "replacements": {
5
+ "title: \"Clear prompt\"": "title: \"清空提示\"",
6
+ "title: \"Submit prompt\"": "title: \"提交提示\"",
7
+ "title: \"Paste\"": "title: \"粘贴\"",
8
+ "title: \"Interrupt session\"": "title: \"中断会话\"",
9
+ "title: \"Open editor\"": "title: \"打开编辑器\"",
10
+ "title: \"Skills\"": "title: \"技能\"",
11
+ "title: \"Stash prompt\"": "title: \"暂存提示\"",
12
+ "title: \"Stash pop\"": "title: \"弹出暂存\"",
13
+ "title: \"Stash list\"": "title: \"暂存列表\"",
14
+ "message: \"Connect a provider to send prompts\"": "message: \"连接提供商以发送提示\"",
15
+ "return `Ask anything...": "return `询问任何问题...",
16
+ "return `Run a command...": "return `运行命令...",
17
+ "\"interrupt\"": "\"中断\"",
18
+ "\"again to interrupt\"": "\"再次中断\"",
19
+ "\"exit shell mode\"": "\"退出终端模式\"",
20
+ "\"gemini is way too hot right now\"": "\"Gemini现在太火爆了\"",
21
+ "\" (click to expand)\"": "\" (点击展开)\""
22
+ }
23
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/tips.tsx",
3
- "description": "提示信息组件",
4
- "replacements": {
5
- ">● Tip </text>": ">● 提示 </text>"
6
- }
7
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/tips.tsx",
3
+ "description": "提示信息组件",
4
+ "replacements": {
5
+ ">● Tip </text>": ">● 提示 </text>"
6
+ }
7
+ }
@@ -1,36 +1,36 @@
1
- {
2
- "name": "opencode-zh",
3
- "version": "1.2.10",
4
- "description": "OpenCode 中文汉化配置文件(模块化结构)",
5
- "lastUpdate": "2026-02-23",
6
- "upstream": {
7
- "repo": "anomalyco/opencode",
8
- "url": "https://github.com/anomalyco/opencode"
9
- },
10
- "modules": {
11
- "dialogs": [
12
- "dialogs/dialog-provider.json",
13
- "dialogs/dialog-status.json",
14
- "dialogs/dialog-model.json",
15
- "dialogs/dialog-agent.json",
16
- "dialogs/dialog-mcp.json"
17
- ],
18
- "components": [
19
- "components/component-prompt.json",
20
- "components/component-tips.json",
21
- "components/autocomplete.json"
22
- ],
23
- "routes": [
24
- "routes/route-sidebar.json",
25
- "routes/route-permission.json"
26
- ],
27
- "common": [
28
- "common/app-messages.json",
29
- "common/error-messages.json",
30
- "common/toast-messages.json"
31
- ],
32
- "root": [
33
- "app.json"
34
- ]
35
- }
36
- }
1
+ {
2
+ "name": "opencode-zh",
3
+ "version": "1.2.10",
4
+ "description": "OpenCode 中文汉化配置文件(模块化结构)",
5
+ "lastUpdate": "2026-02-23",
6
+ "upstream": {
7
+ "repo": "anomalyco/opencode",
8
+ "url": "https://github.com/anomalyco/opencode"
9
+ },
10
+ "modules": {
11
+ "dialogs": [
12
+ "dialogs/dialog-provider.json",
13
+ "dialogs/dialog-status.json",
14
+ "dialogs/dialog-model.json",
15
+ "dialogs/dialog-agent.json",
16
+ "dialogs/dialog-mcp.json"
17
+ ],
18
+ "components": [
19
+ "components/component-prompt.json",
20
+ "components/component-tips.json",
21
+ "components/autocomplete.json"
22
+ ],
23
+ "routes": [
24
+ "routes/route-sidebar.json",
25
+ "routes/route-permission.json"
26
+ ],
27
+ "common": [
28
+ "common/app-messages.json",
29
+ "common/error-messages.json",
30
+ "common/toast-messages.json"
31
+ ],
32
+ "root": [
33
+ "app.json"
34
+ ]
35
+ }
36
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/dialog-agent.tsx",
3
- "description": "代理选择对话框",
4
- "replacements": {
5
- "title=\"Select agent\"": "title=\"选择代理\""
6
- }
7
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/dialog-agent.tsx",
3
+ "description": "代理选择对话框",
4
+ "replacements": {
5
+ "title=\"Select agent\"": "title=\"选择代理\""
6
+ }
7
+ }
@@ -1,11 +1,11 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/dialog-mcp.tsx",
3
- "description": "MCP服务器管理对话框",
4
- "replacements": {
5
- "title=\"MCPs\"": "title=\"MCP服务器\"",
6
- "title: \"toggle\"": "title: \"切换\"",
7
- ">⋯ Loading</span>": ">⋯ 加载中</span>",
8
- ">✓ Enabled</span>": ">✓ 已启用</span>",
9
- ">○ Disabled</span>": ">○ 已禁用</span>"
10
- }
11
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/dialog-mcp.tsx",
3
+ "description": "MCP服务器管理对话框",
4
+ "replacements": {
5
+ "title=\"MCPs\"": "title=\"MCP服务器\"",
6
+ "title: \"toggle\"": "title: \"切换\"",
7
+ ">⋯ Loading</span>": ">⋯ 加载中</span>",
8
+ ">✓ Enabled</span>": ">✓ 已启用</span>",
9
+ ">○ Disabled</span>": ">○ 已禁用</span>"
10
+ }
11
+ }
@@ -1,15 +1,15 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/dialog-model.tsx",
3
- "description": "模型选择对话框",
4
- "replacements": {
5
- "title=\"Select model\"": "title=\"选择模型\"",
6
- "title: \"Connect provider\"": "title: \"连接提供商\"",
7
- "title: \"View all providers\"": "title: \"查看所有提供商\"",
8
- "title: \"Favorite\"": "title: \"收藏\"",
9
- "category: \"Favorites\"": "category: \"收藏\"",
10
- "category: \"Recent\"": "category: \"最近使用\"",
11
- "category: \"Popular providers\"": "category: \"热门提供商\"",
12
- "(Favorite)": "(已收藏)",
13
- "footer: \"Free\"": "footer: \"免费\""
14
- }
15
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/dialog-model.tsx",
3
+ "description": "模型选择对话框",
4
+ "replacements": {
5
+ "title=\"Select model\"": "title=\"选择模型\"",
6
+ "title: \"Connect provider\"": "title: \"连接提供商\"",
7
+ "title: \"View all providers\"": "title: \"查看所有提供商\"",
8
+ "title: \"Favorite\"": "title: \"收藏\"",
9
+ "category: \"Favorites\"": "category: \"收藏\"",
10
+ "category: \"Recent\"": "category: \"最近使用\"",
11
+ "category: \"Popular providers\"": "category: \"热门提供商\"",
12
+ "(Favorite)": "(已收藏)",
13
+ "footer: \"Free\"": "footer: \"免费\""
14
+ }
15
+ }
@@ -1,21 +1,21 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/dialog-provider.tsx",
3
- "description": "提供商连接对话框",
4
- "replacements": {
5
- "title=\"Select auth method\"": "title=\"选择认证方式\"",
6
- "title=\"Connect a provider\"": "title=\"连接提供商\"",
7
- "placeholder=\"Authorization code\"": "placeholder=\"授权码\"",
8
- "placeholder=\"API key\"": "placeholder=\"API密钥\"",
9
- "label: \"API key\"": "label: \"API密钥\"",
10
- "(Recommended)": "(推荐)",
11
- "(Claude Max or API key)": "(Claude Max 或 API密钥)",
12
- "(ChatGPT Plus/Pro or API key)": "(ChatGPT Plus/Pro 或 API密钥)",
13
- "? \"Popular\" : \"Other\"": "? \"热门\" : \"其他\"",
14
- "<text fg={theme.textMuted}>Waiting for authorization...</text>": "<text fg={theme.textMuted}>等待授权...</text>",
15
- "<text fg={theme.error}>Invalid code</text>": "<text fg={theme.error}>无效的授权码</text>",
16
- "c <span style={{ fg: theme.textMuted }}>copy</span>": "c <span style={{ fg: theme.textMuted }}>复制</span>",
17
- "OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API key.": "OpenCode Zen 以最低的价格为您提供所有最佳编码模型的访问权限,只需一个 API 密钥。",
18
- "Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key": "前往 <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> 获取密钥",
19
- "message: \"Copied to clipboard\"": "message: \"已复制到剪贴板\""
20
- }
21
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/dialog-provider.tsx",
3
+ "description": "提供商连接对话框",
4
+ "replacements": {
5
+ "title=\"Select auth method\"": "title=\"选择认证方式\"",
6
+ "title=\"Connect a provider\"": "title=\"连接提供商\"",
7
+ "placeholder=\"Authorization code\"": "placeholder=\"授权码\"",
8
+ "placeholder=\"API key\"": "placeholder=\"API密钥\"",
9
+ "label: \"API key\"": "label: \"API密钥\"",
10
+ "(Recommended)": "(推荐)",
11
+ "(Claude Max or API key)": "(Claude Max 或 API密钥)",
12
+ "(ChatGPT Plus/Pro or API key)": "(ChatGPT Plus/Pro 或 API密钥)",
13
+ "? \"Popular\" : \"Other\"": "? \"热门\" : \"其他\"",
14
+ "<text fg={theme.textMuted}>Waiting for authorization...</text>": "<text fg={theme.textMuted}>等待授权...</text>",
15
+ "<text fg={theme.error}>Invalid code</text>": "<text fg={theme.error}>无效的授权码</text>",
16
+ "c <span style={{ fg: theme.textMuted }}>copy</span>": "c <span style={{ fg: theme.textMuted }}>复制</span>",
17
+ "OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API key.": "OpenCode Zen 以最低的价格为您提供所有最佳编码模型的访问权限,只需一个 API 密钥。",
18
+ "Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key": "前往 <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> 获取密钥",
19
+ "message: \"Copied to clipboard\"": "message: \"已复制到剪贴板\""
20
+ }
21
+ }
@@ -1,17 +1,17 @@
1
- {
2
- "file": "src/cli/cmd/tui/component/dialog-status.tsx",
3
- "description": "状态对话框",
4
- "replacements": {
5
- ">Status</text>": ">状态</text>",
6
- "<text fg={theme.text}>No MCP Servers</text>": "<text fg={theme.text}>无MCP服务器</text>",
7
- "<text fg={theme.text}>No Formatters</text>": "<text fg={theme.text}>无格式化器</text>",
8
- "<text fg={theme.text}>No Plugins</text>": "<text fg={theme.text}>无插件</text>",
9
- " MCP Servers</text>": " 个MCP服务器</text>",
10
- " Formatters</text>": " 个格式化器</text>",
11
- " Plugins</text>": " 个插件</text>",
12
- " LSP Servers</text>": " 个LSP服务器</text>",
13
- ">Connected</Match>": ">已连接</Match>",
14
- ">Disabled in configuration</Match>": ">配置中已禁用</Match>",
15
- "Needs authentication (run: opencode mcp auth {key})": "需要认证(运行: opencode mcp auth {key})"
16
- }
17
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/component/dialog-status.tsx",
3
+ "description": "状态对话框",
4
+ "replacements": {
5
+ ">Status</text>": ">状态</text>",
6
+ "<text fg={theme.text}>No MCP Servers</text>": "<text fg={theme.text}>无MCP服务器</text>",
7
+ "<text fg={theme.text}>No Formatters</text>": "<text fg={theme.text}>无格式化器</text>",
8
+ "<text fg={theme.text}>No Plugins</text>": "<text fg={theme.text}>无插件</text>",
9
+ " MCP Servers</text>": " 个MCP服务器</text>",
10
+ " Formatters</text>": " 个格式化器</text>",
11
+ " Plugins</text>": " 个插件</text>",
12
+ " LSP Servers</text>": " 个LSP服务器</text>",
13
+ ">Connected</Match>": ">已连接</Match>",
14
+ ">Disabled in configuration</Match>": ">配置中已禁用</Match>",
15
+ "Needs authentication (run: opencode mcp auth {key})": "需要认证(运行: opencode mcp auth {key})"
16
+ }
17
+ }
@@ -1,20 +1,20 @@
1
- {
2
- "file": "src/cli/cmd/tui/routes/session/permission.tsx",
3
- "description": "权限请求组件",
4
- "replacements": {
5
- "title=\"Permission required\"": "title=\"需要权限\"",
6
- "title=\"Always allow\"": "title=\"始终允许\"",
7
- "title=\"Reject permission\"": "title=\"拒绝权限\"",
8
- "options={{ once: \"Allow once\", always: \"Allow always\", reject: \"Reject\" }}": "options={{ once: \"允许一次\", always: \"始终允许\", reject: \"拒绝\" }}",
9
- "options={{ confirm: \"Confirm\", cancel: \"Cancel\" }}": "options={{ confirm: \"确认\", cancel: \"取消\" }}",
10
- ">Permission required</text>": ">需要权限</text>",
11
- ">Reject permission</text>": ">拒绝权限</text>",
12
- ">Tell OpenCode what to do differently</text>": ">告诉OpenCode该怎么做</text>",
13
- "This will allow": "这将允许",
14
- "until OpenCode is restarted": "直到OpenCode重启",
15
- "This will allow the following patterns until OpenCode is restarted": "这将允许以下模式直到OpenCode重启",
16
- ">Continue after repeated failures</text>": ">多次失败后继续</text>",
17
- "Access external directory": "访问外部目录",
18
- "Call tool": "调用工具"
19
- }
20
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/routes/session/permission.tsx",
3
+ "description": "权限请求组件",
4
+ "replacements": {
5
+ "title=\"Permission required\"": "title=\"需要权限\"",
6
+ "title=\"Always allow\"": "title=\"始终允许\"",
7
+ "title=\"Reject permission\"": "title=\"拒绝权限\"",
8
+ "options={{ once: \"Allow once\", always: \"Allow always\", reject: \"Reject\" }}": "options={{ once: \"允许一次\", always: \"始终允许\", reject: \"拒绝\" }}",
9
+ "options={{ confirm: \"Confirm\", cancel: \"Cancel\" }}": "options={{ confirm: \"确认\", cancel: \"取消\" }}",
10
+ ">Permission required</text>": ">需要权限</text>",
11
+ ">Reject permission</text>": ">拒绝权限</text>",
12
+ ">Tell OpenCode what to do differently</text>": ">告诉OpenCode该怎么做</text>",
13
+ "This will allow": "这将允许",
14
+ "until OpenCode is restarted": "直到OpenCode重启",
15
+ "This will allow the following patterns until OpenCode is restarted": "这将允许以下模式直到OpenCode重启",
16
+ ">Continue after repeated failures</text>": ">多次失败后继续</text>",
17
+ "Access external directory": "访问外部目录",
18
+ "Call tool": "调用工具"
19
+ }
20
+ }
@@ -1,14 +1,14 @@
1
- {
2
- "file": "src/cli/cmd/tui/routes/session/sidebar.tsx",
3
- "description": "侧边栏组件",
4
- "replacements": {
5
- ">Context</text>": ">上下文</text>",
6
- " tokens</text>": " 令牌</text>",
7
- "% used</text>": "% 已使用</text>",
8
- " spent</text>": " 已花费</text>",
9
- ">MCP</text>": ">MCP</text>",
10
- " active</span>": " 活跃</span>",
11
- " error</span>": " 错误</span>",
12
- " errors</span>": " 错误</span>"
13
- }
14
- }
1
+ {
2
+ "file": "src/cli/cmd/tui/routes/session/sidebar.tsx",
3
+ "description": "侧边栏组件",
4
+ "replacements": {
5
+ ">Context</text>": ">上下文</text>",
6
+ " tokens</text>": " 令牌</text>",
7
+ "% used</text>": "% 已使用</text>",
8
+ " spent</text>": " 已花费</text>",
9
+ ">MCP</text>": ">MCP</text>",
10
+ " active</span>": " 活跃</span>",
11
+ " error</span>": " 错误</span>",
12
+ " errors</span>": " 错误</span>"
13
+ }
14
+ }