Sodapopper-pixel/dsh-cot-translator-plus ↗★ 0
dsh-cot-translator-plus
把展开的思考内容翻译成界面语言或指定语言:支持任意 HTTP 翻译站点模板,以及模型翻译(DSH 已注册提供商或插件自带的 OpenAI 兼容自定义提供商)。Translate expanded reasoning through configurable HTTP translation sites or an LLM route. 适合需要阅读外语思考过程的用户,支持自定义翻译接口与大模型路由。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Sodapopper-pixel/dsh-cot-translator-plusREADME
Read the full README ↗使用
展开任意思考行,工具栏出现服务下拉框与「查看原文」。插件设置页(插件 → 已安装插件 → dsh-cot-translator-plus)提供默认服务、目标语言、单次文本上限、缓存条数、超时、LLM 路由、站点 JSON 与「试译」。
auto 目标语言跟随界面语言;也可以直接写语言代码(zh、en、ja…)。
站点配置
站点是一个 JSON 数组,每项描述一次 HTTP 调用:
| 字段 | 说明 |
|---|---|
id | 1–32 位字母、数字、_、-。与预置站点同名即覆盖该站点;{"id":"bing","disabled":true} 可移除 |
label | 工具栏与设置页显示的名字 |
endpoint | 接口地址模板,支持 {{text}}、{{source}}、{{target}} 占位,以及 |url(百分号编码)与 |json(JSON 字符串字面量)过滤器 |
method | GET、POST、PUT;GET 不带请求体 |
contentType、headers | 请求头;名称与值会校验,禁止换行 |
body | 请求体模板,占位符同上 |
responseType | json(默认)或 text |
responsePaths | 点分路径数组,按顺序取第一个非空字符串,例如 0.translations.0.text |
responseJoin | 分段响应:{"path":"0","index":0} 把 path 处数组每项的第 index 个字符串拼起来(Google 用) |
languageMap | 本机语言标签到站点语言的映射,大小写不敏感 |
DeepL 示例:
{
"id": "deepl",
"label": "DeepL",
"endpoint": "https://api-free.deepl.com/v2/translate",
"method": "POST",
"contentType": "application/x-www-form-urlencoded",
"body": "text={{text|url}}&target_lang={{target}}",
"headers": { "authorization": "DeepL-Auth-Key " },
"responseType": "json",
"responsePaths": ["translations.0.text"],
"languageMap": { "zh": "ZH", "en": "EN" }
}
预置 bing 与 google 免密钥。匿名 Google 端点在部分网络下不可达,此时会走失败分支(保留原文 + 重试)。