fix(docs): locale translations

This commit is contained in:
Adam
2026-02-10 07:11:13 -06:00
parent 19ad7ad809
commit 4c4e30cd71
351 changed files with 3744 additions and 3765 deletions

View File

@@ -11,7 +11,7 @@ description: 编写您自己的插件来扩展 opencode。
## 使用插件
兩種加載插件的方法。
两种加載插件的方法。
---
@@ -22,7 +22,7 @@ description: 编写您自己的插件来扩展 opencode。
- `.opencode/plugins/` - 项目级插件
- `~/.config/opencode/plugins/` - 全局插件
些目中的文件會在啟動時自加載。
些目中的文件会在启动時自加載。
---
@@ -43,7 +43,7 @@ description: 编写您自己的插件来扩展 opencode。
---
### 插件是如何安
### 插件是如何安
**npm 插件** 在启动时使用 Bun 自动安装。包及其依赖项缓存在 `~/.cache/opencode/node_modules/` 中。
@@ -51,9 +51,9 @@ description: 编写您自己的插件来扩展 opencode。
---
### 加載
### 加載
插件從所有源加載,所有掛鉤按序運行。加載順序為
插件從所有源加載,所有掛鉤按序運行。加載顺序为
1. 全局配置 (`~/.config/opencode/opencode.json`)
2. 项目配置(`opencode.json`
@@ -64,10 +64,10 @@ description: 编写您自己的插件来扩展 opencode。
---
## 建一插件
## 建一插件
插件是一个 **JavaScript/TypeScript 模块多个**,它导出一个或插件
功能。每函數接收一上下文對象並返回一鉤子象。
功能。每函數接收一上下文对象并返回一鉤子象。
---
@@ -139,7 +139,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
---
### 活
### 活
插件可以訂閱事件,如下面的示例部分所示。以下是可用的不同事件的列表。
@@ -152,7 +152,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `file.edited`
- `file.watcher.updated`
#### 安裝活動
#### 安装活动
- `installation.updated`
@@ -168,7 +168,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `message.removed`
- `message.updated`
#### 限事件
#### 限事件
- `permission.asked`
- `permission.replied`
@@ -177,7 +177,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `server.connected`
#### 會議活動
#### 会话活动
- `session.created`
- `session.compacted`
@@ -188,11 +188,11 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `session.status`
- `session.updated`
#### 都都活
#### 都都活
- `todo.updated`
#### 殼牌活
#### 殼牌活
- `shell.env`
@@ -201,7 +201,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `tool.execute.after`
- `tool.execute.before`
#### TUI 活
#### TUI 活
- `tui.prompt.append`
- `tui.command.execute`
@@ -217,7 +217,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
### 發送通知
某些事件發生時發送通知:
某些事件發生時發送通知:
```js title=".opencode/plugins/notification.js"
export const NotificationPlugin = async ({ project, client, $, directory, worktree }) => {
@@ -306,7 +306,7 @@ export const CustomToolsPlugin: Plugin = async (ctx) => {
- `args`Zod 模式的工具参数
- `execute`:调用工具时运行的函数
您的自定義工具將可與內置工具一起用opencode。
您的自定義工具将可与内置工具一起用opencode。
---
@@ -333,7 +333,7 @@ export const MyPlugin = async ({ client }) => {
### 壓實鉤
自定義壓縮會話時包含的上下文:
自定義壓縮会话時包含的上下文:
```ts title=".opencode/plugins/compaction.ts"
import type { Plugin } from "@opencode-ai/plugin"