Markdown to Chinese · DSH plugin
Read a Markdown file in the DeepSeek Harness Web GUI's right panel in Chinese.
The plugin adds a 中文 action to the header of the file preview. One press opens a tab beside the document with the whole file machine-translated, rendered as Markdown. The original file is never modified.
English | 中文
Features
- One action, no setup. Appears only for
.md/.markdown/.mdxfiles, next to the preview's own controls. - Structure survives translation. Headings, lists, tables, quotes, links, images, code blocks and a leading YAML frontmatter block keep their shape. Fenced code is never sent for translation.
- Syntax is protected. Inline code and link/image destinations are masked behind tokens before the text is sent, because machine translation rewrites their punctuation (backticks become quotation marks, ASCII parentheses become full-width ones). They are restored afterwards.
- Progressive. Long documents are split at block boundaries and translated in sequence, so reading starts before the last chunk arrives. A Stop control cancels a run and keeps what is done.
- Kept alive. The tab body stays mounted across tab switches, pane moves and a collapsed column, so a finished translation is not thrown away or sent again.
- Honest failure states. Each Host request has a 60-second deadline; failures keep the finished part and show a localized reason with a retry control.
Requirements
- DeepSeek Harness
0.2.x(declared asengines.dsh; tested on0.2.2-rc.5). - The Web GUI (
dsh webor the Desktop app). - A mounted translation service in the Host composition: the
translatorplugin. It ships with the experimental CoT-translation bundle, which most profiles already have. Without it the tab reports that no translation service is enabled instead of failing silently.
Install
Graphical interface: Plugins → Add plugin, then paste one of
git+https://github.com/hrz-x/dsh-md-zh-translate.git
dsh-md-zh-translate # once published to npm
Command line:
dsh plugin --profile desktop add git+https://github.com/hrz-x/dsh-md-zh-translate.git
Quit the Desktop app before running the CLI for its profile. After installing, refresh the open page (Ctrl+R) so the new browser bundle loads, and enable the bundle in Plugins if it is not on yet.
A Git spec that names a branch or tag installs but does not appear as updatable in Plugins; the update flow needs an npm package or a Git spec pinned to a full commit.
Use
- Open a Markdown file in the right panel — from Files, a chat file link, or any preview.
- Press 中文 in the file's header row. The tooltip names the action and warns that the text is sent for translation.
- The translation opens as a tab titled
Chinese · <file name>. Split the pane to read both side by side. - Stop ends a run; Retry restarts it from the beginning; Translate again reruns a finished translation. A document detected as already Chinese is shown as-is until you ask to translate it anyway.
How it works
| Piece | Where |
|---|---|
| Header action | slot sidebar.right.tab.document.actions |
| Translation tab | tab kind markdown-zh, body in slot sidebar.right.pane.tab |
| Source read | POST /dsh-md-zh-translate/source → ctx.fs |
| Translation | POST /dsh-md-zh-translate/translate → ctx.translator |
| Rendering | the plugin's own Markdown renderer (React elements, no innerHTML) |
The Host routes accept only same-origin requests from the GUI page, cap the source at 4 MiB, and answer JSON with a stable code so the page can show a localized reason.
What leaves this machine
The document text is sent to the Host's translation service — the profile's translator plugin, Bing by default, or whatever provider that plugin is configured with. Translate only documents you may share with that service. Images in the translated document load from their own URL or through the authenticated api/file route; nothing is written to the session log.
Limitations
- Machine translation is reference material, not an editable translation.
- One request at a time per tab; a very long document takes a while even though it renders progressively.
- Embedded HTML in the source is shown as text, and links with a non-web scheme (
javascript:,data:) are shown as plain text. - A page reload remounts open translation tabs and translates them again.
Development
No build step: client.js is the browser bundle in the web client's lazy-CJS format, index.js is the Host half.
node scripts/check.mjs # manifest, locales, bundle id, patch, packaged files
The checks also run in CI on every push.
No comments yet. Be the first to write one.