- Início
- Plugins
- Melhorias de UI
- dsh-cot-zh
dsh-cot-zh
hfdxgone/dsh-cot-zh
Machine-translates the expanded Think body into Chinese while the agent writes it, with one click back to the English original. Splits reasoning by paragraph, translates only finished paragraphs, caches results, and calls the public Microsoft Translator endpoint, so no API key is needed.
Instalar
dsh plugin --profile web add github:hfdxgone/dsh-cot-zhREADME
dsh-cot-zh
English | 中文
Replaces DSH's expanded Think body with a Simplified Chinese machine translation, with the original one click away.
- Browser-side translation: the translation comes from Microsoft's Edge translate endpoint (
edge.microsoft.com/translate/translatetext); no account, key, or proxy is involved. - Translates while the agent writes: a completed paragraph is replaced as soon as its translation arrives; the paragraph still streaming stays in English until it completes.
- Paragraph cache: translated paragraphs go into memory and
localStorage, so re-expanding a row or reloading the page costs no request. - Visible failure: a failed paragraph falls back to the original with a retry button instead of blanking the body.
- Raw text untouched: only the expanded rendering changes; the session's stored reasoning text and the collapsed Think summary stay as written.
Use
Expand any Think row and a toolbar appears above the body:
| Element | Meaning |
|---|---|
查看原文 / 查看译文 | Switch between the original and the translation; the translation is shown by default |
翻译中… | Some paragraphs have no translation yet |
翻译失败 + 重试 | The request failed; the body falls back to the original |
Turning the bundle off (Plugins → Installed → dsh-cot-zh) restores the untouched reasoning body.
Privacy and cost
- Reasoning text goes from the browser straight to
edge.microsoft.com(Microsoft). No key is needed, but the text does leave this machine; turn the bundle off when that is unacceptable. - One
POSTper paragraph, three at a time; a paragraph longer than 3000 characters is split at a line break or space. - Translations are cached in the browser's
localStorageunder thedsh-cot-zh:v1:prefix, with at most 400 in-memory entries. - Only the expanded body is replaced: the collapsed Think summary keeps its original text.
Implementation
A single-package bundle with no build step and no runtime dependencies:
cordis.patch.ymlinserts onecot-zhrow;applyinindex.jsis empty, because the Host takes no part in translation.client.jsis a hand-written browser module (window.__ModuleLoader__.load({ id, factory })) registering into the slotconversation.chat.reasoning.bodywithpriority: 90, so it shadows the shipped body at priority 100. It renders Markdown through the root-scope factoryconversation.chat.reasoning.content, so code blocks and footnotes keep their formatting.- Paragraph splitting preserves the original blank-line separators; oversized paragraphs are cut at a line break, then a space, into pieces of at most 3000 characters.
Known limitations
- Simplified Chinese only (
to=zh-Hans); the toolbar copy is Chinese. - No glossary protection: machine translation may rewrite inline identifiers.
- Microsoft's endpoint has no SLA; a blocked network or a rate limit ends in the failure state and needs a retry.
- DSH's experimental bundle
@deepseek-ai/dsh-experimental-cot-translation-bundleoccupies the same slot; enabling both makes them compete for one body position, so keep only one.
License
MIT, see LICENSE. Use it, change it, ship it commercially - just keep the copyright notice. No warranty.
Plugins relacionados
dsh-web (dsh-task-board)
zhu1090093659/dsh-web
dsh-web (dsh-web-all)
zhu1090093659/dsh-web
dsh-TUI
ccch1mneyyy/dsh-tui
dsh-web-ui (dsh-task-board)
zhu1090093659/dsh-web-ui