DeepSHPlugins
dsh-plugins#to-english 项目预览
GITHUB / COMMUNITY PROJECT

dsh-plugins#to-english

生态与开发JavaScriptMIT

用你已经配置好的模型,把从市场安装的插件里的中文文案改写成英文——安装时自动运行,随后热重载。每个文件整体翻译一遍,凡是有解析器的都会实际校验(JavaScript 用 node --check,其余用 JSON、YAML 解析器),失败时把报错交回模型,最多修复三次;超过 48 KB 或始终无法解析的文件,回退到按行区间翻译,逐行与原文做结构比对。触发短语与本地化表可以选择保留而不翻译,未改动的原文件保留在同目录下的 .zh.bak。

5 StarsCREAIT-nl 更新时间 2026-08-26
访问 GitHub 仓库
dsh-plugins#to-english 项目预览

项目介绍

中文

用你已经配置好的模型,把从市场安装的插件里的中文文案改写成英文——安装时自动运行,随后热重载。每个文件整体翻译一遍,凡是有解析器的都会实际校验(JavaScript 用 node --check,其余用 JSON、YAML 解析器),失败时把报错交回模型,最多修复三次;超过 48 KB 或始终无法解析的文件,回退到按行区间翻译,逐行与原文做结构比对。触发短语与本地化表可以选择保留而不翻译,未改动的原文件保留在同目录下的 .zh.bak。

English

Rewrites the Chinese copy of a market-installed plugin into English using a model already configured in the harness — automatically when the plugin is installed, then live-reloaded. Each file is translated in one whole-file pass, validated by a real parser where one exists (node --check for JavaScript, JSON and YAML parsers otherwise) and handed back to the model with the error for up to three repair attempts; files above 48 KB, or that never parse, fall back to a line-range pass that checks every returned line against the original for structure. Trigger phrases and locale tables can optionally be preserved rather than translated, and the untouched original is kept beside the file as a .zh.bak.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
CREAIT-nl
仓库
CREAIT-nl/dsh-plugins#to-english
GitHub Stars
5
Forks
2
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-26
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

73/ 100
维护活跃
90
文档与实用信息
74
生态关注度
35
安装便捷信号
100
项目声明信号
100

近 16 天仍在更新;标准命令一键安装。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add @creait/dsh-to-english

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

@creait/dsh-to-english

Rewrites a market-installed plugin's Chinese copy into English, using a model you already have configured — once when it lands, then live-reloaded.

Most of the DSH plugin market is written in Chinese. Installing from it gives you a working plugin whose settings page, tool descriptions, log lines and README you cannot read. Translating by hand is a per-plugin chore that has to be redone on every update, and a blunt "replace every CJK run" pass produces something worse: a plugin that reads English and no longer works.

The untouched original is always kept beside the file as .zh.bak.

How it translates

One pass over the whole file is the default. The model is handed the entire file and returns the entire file. What stands behind it is not a diff gate but a parser: node --check for .js/.cjs/.mjs (on a sibling temp file, so the package's own type field decides script-vs-module exactly as it will at load time), JSON.parse for .json, a YAML parse for .yml/.yaml. A file that fails is handed back to the model with the parser's complaint, up to three repair round-trips. A reply shorter than 60% of the original is treated as truncated rather than as a translation — prose has no parser to catch a half-written README.

Files up to 48 KB go through this path. Above that the model would have to echo back more than the completion budget allows.

The segment path is the fallback. For a file too large to echo back, or one the model could never get past its parser, the older pipeline still runs: only line ranges containing Chinese are sent, the reply must have the same number of lines, and each line is checked against the original's code skeleton before it is accepted. A conservative partial translation beats none at all. Nothing above 512 KB is touched at all.

Why the default moved: the skeleton comparison is safe, and it is also why Chinese that has to change *shape* to become English never translated. /^[好嗯啊]*\s*继续/ has to become /^(ok|um|ah)*\s*continue/ — a character class turning into an alternation, because Chinese marks optionality per character and English words are longer than one character. Every such line came back rejected.

What that trades away is real and worth stating: node --check catches a file that stopped parsing, not one that still parses and now means something else. A renamed identifier, a reworded id: in cordis.patch.yml, a translated "main" in package.json all survive their parser. The contract asks the model to leave those alone; nothing enforces it. Read the diff against .zh.bak.

What it will not translate

translateEverything (default true) decides whether Chinese the *program* matches on is rewritten or preserved. On an English-only harness, preserving it just leaves a feature switched off — the phrases that would fire it can never be typed — so the default is to translate it, and to change its shape where English demands a different one. Turn it off and the segment path locks three shapes:

Match data. dsh-recall's auto-recall gate is ~324 characters of Chinese trigger phrases and Chinese regexes. A line holding a regex literal with CJK, or a line that is only quoted literals and commas, is locked.

The non-English half of an i18n table. A var zh = {…} next to a var en = {…} is already bilingual; rewriting zh serves English to the people who deliberately picked Chinese. A brace-depth scan from a head line bound to a non-English language tag locks the block.

Two things are locked regardless of that setting.

Names the code looks up. Variable and function names, object keys, import and route paths, settings namespaces, and the id, name and main fields of package.json and cordis.patch.yml. In the segment path keepsStructure enforces this by comparing the code skeleton, and YAML gets its own gate — a quoted scalar is writable only if the *original* held CJK, so prompt: "你是助手" translates and name: 'dsh-enhance' does not. In the whole-file path this is a contract clause, not a gate.

Protocol strings. lib/semantic.js's QUERY_PREFIX in dsh-recall is the BGE embedding model's required instruction prefix. It belongs to the checkpoint, not to the user: a model trained on Chinese instructions expects its Chinese instruction whatever language the query is in. No deterministic rule catches this — it is a prompt clause in both paths. Review the diff.

README.zh.md and its siblings are skipped outright — the English README is the file next to it, and translating it spends the budget producing a second English README under a name that says it is Chinese. A README.md that is itself the localized half (a Chinese README.md beside an English README_EN.md) is skipped the same way.

The one structural edit the segment path allows

"请求 " + <b>{n}</b> + " 次" puts the measure word after the number and English puts it in front, so the trailing literal has nothing left to hold and must go. dropsOnlyAffixes permits that deletion under narrow terms — only a short CJK literal, at most two per line, exactly one separator removed each, and only when another Chinese literal on the same line survives, so t("中文标题", fallback) cannot quietly lose an argument. Every such acceptance is logged and listed under relaxed in the file report.

Install

Not on npm yet, and pnpm cannot install a subdirectory of a git repo — so clone the repo and point the profile at the folder:

git clone https://github.com/CREAIT-nl/dsh-plugins.git
dsh plugin --profile web add ./dsh-plugins/to-english

That records a link: rather than copying the package in, which is what you want here: pnpm does not install a link target's dependencies into the linking project, so the profile's node_modules stays free of a second copy of any @deepseek-ai/* runtime. Run pnpm install inside to-english/ once, then restart dsh web — the boot manifest is built at startup.

The package ships its own cordis.patch.yml, so it inserts its roster row on its own — no manual profile edit. Add it to dsh.profile.bundles to activate the browser half.

Configure

Settings live in the dsh-to-english namespace, or in the GUI at Settings → To English.

KeyDefaultWhat it does
enabledtrueRun automatically when a plugin is installed.
provider / model''Which configured model translates. Empty means the first available.
promptstyle guidanceEditable. Style only — the mechanical contract lives in WHOLE_FILE_RULES and PROTOCOL_SYSTEM, where an edited prompt cannot weaken it.
rewriteRadius1Segment path only. Lines without Chinese on each side of a Chinese line that are also open to rewriting. 0 leaves a mixed passage reading like a graft; 1 lets the model repair the English clause the Chinese was joined to. Capped at 5.
translateEverythingtrueTranslate the match data and locale tables described above rather than preserving them. The gates that stop the model renaming *code* are unaffected.

The automatic run fires on a new top-level package directory appearing in the profile's node_modules. Anything installed before this plugin existed never crossed that trigger — use the settings section's Translate now box, which takes a package name and runs the same pipeline.

Routes

Loopback-only, mirroring the gen-limit settings-route pattern — the harness settings wire only exposes namespaces on its own allowlist, which a plugin cannot widen:

RoutePurpose
GET/POST /api/dsh-to-english/configread/write the settings above
GET /api/dsh-to-english/cataloglive provider/model list
POST /api/dsh-to-english/translatetranslate + reload one installed plugin now
GET /api/dsh-to-english/statusenabled, provider, model, last run

What breaks this

The watcher, the settings provider and the live-reload seam are pre-1.0 internal dsh surfaces with no compatibility guarantee. peerDependencies pins the versions this was built against; a harness upgrade can move them.

Translation is a model call, so it is not deterministic. In the segment path a line that fails its check is left in Chinese and counted in the report. In the whole-file path a file that fails its parser three times is abandoned and falls back to segments. Neither can make a mediocre translation good, and neither catches a change that parses. Read the report, and for anything carrying a protocol string, read the diff.

The settings nav glyph is a deliberate reach past the API. settings.section has no icon option — the shell picks the glyph from a hardcoded section-id map and falls back to the gear for ids it does not know, ours included. So the client half repaints its own row: it finds the nav cell by label and replaces the gear's markup with the official IconListPenOutline16. It fails safe — if the shell's markup moves, nothing matches and the row keeps the gear.

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目