DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

hrz-x /

hrz-x/dsh-md-zh-translate

Verified

在 DeepSeek Harness Web GUI 的右侧面板里,用中文读 Markdown 文件。

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@1c1fcc0e

Markdown to Chinese · DSH plugin

validate

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 / .mdx files, 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 as engines.dsh; tested on 0.2.2-rc.5).
  • The Web GUI (dsh web or the Desktop app).
  • A mounted translation service in the Host composition: the translator plugin. 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

  1. Open a Markdown file in the right panel — from Files, a chat file link, or any preview.
  2. Press 中文 in the file's header row. The tooltip names the action and warns that the text is sent for translation.
  3. The translation opens as a tab titled Chinese · <file name>. Split the pane to read both side by side.
  4. 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.

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 1c1fcc0e84ca

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout