dsh-translate-on-select: Translate selected text within DSH without leaving the current page

Preface

When reading English documentation or foreign-language fragments in assistant replies inside DeepSeek Harness (DSH), the common practice is to switch to a browser translation extension, copy text into an online dictionary, or open a new window. These steps interrupt the current conversation context. Below we introduce a community plugin dsh-translate-on-select: select non-Chinese text with your mouse inside a DSH page, and upon releasing, a Simplified Chinese translation card will pop up inline just below the selection — no keyboard shortcuts, browser extensions, or redirects needed.

The DSH ecosystem emphasizes “everything is a plugin”; the plugin directory is maintained by the community site and has no official affiliation with DeepSeek / 幻方 (Hunyuan). The facts in this article come from the plugin’s GitHub README and package information; installation and configuration should follow the original sources.

What Is This

dsh-translate-on-select is published by maintainer syzke and categorized as a network tool. In one sentence: a select-to-translate plugin for DSH — after selecting non-Chinese content with the mouse, a card floats up inline below the selection showing the Simplified Chinese translation (Select-to-translate plugin for DeepSeek Harness).

The current npm package version is 0.1.1, licensed under MIT. It is implemented in pure JavaScript with zero third-party dependencies and no prepare/build scripts.

Core Features

Selection and Display

  1. Select to translate: about 200ms after releasing the mouse, a translation request is sent automatically; the card appears directly below the selection, and flips above if there is not enough space below.
  2. Automatic detection of whether translation is needed: purely Chinese selections are skipped directly; Japanese and Korean text is correctly identified as needing translation due to the presence of kana/hangul.
  3. Non-intrusive to input: selections inside input boxes, text areas, and contenteditable elements will not trigger it.
  4. Source language detection: English, Japanese, German, etc. can be recognized, and the card will display something like “English → Simplified Chinese”.

Experience and Interaction

  • Frosted-glass card, rounded corners and shadows, follows the DSH / system light and dark themes; a skeleton screen appears during loading; prefers-reduced-motion is respected.
  • Supports copying the translation and re-translating; Esc or clicking on empty space closes the card.
  • Caching: selecting the same text again returns instantly (one layer of memory LRU on the host and one on the frontend).

Translation Backend

The primary backend is cn.bing.com, with automatic fallback to MyMemory on failure. Requests are sent from the host side (only listening on 127.0.0.1 by default), and the frontend calls a local route POST /dsh-translate/translate, making it easy to bypass CORS, centralize chunking, and implement multi-backend fallback.

Installation and Activation

You need to have the dsh CLI installed (bundled with the desktop client; when running from source you can use pnpm dsh).

dsh plugin --profile desktop add dsh-translate-on-select
  • The desktop client uses the desktop profile; if you are running dsh web, replace --profile desktop with --profile web.
  • The package has been published on npm: dsh-translate-on-select.
  • No local installation of git is required; there are no build scripts, so generally there is no need to add allowBuilds to pnpm-workspace.yaml.

Method 2: Install from GitHub

dsh plugin --profile desktop add github:syzke/dsh-translate-on-select

Requires git to be installed locally. Example for pinning a version:

dsh plugin --profile desktop add github:syzke/dsh-translate-on-select#v0.1.1
dsh plugin --profile desktop add "link:/absolute/path/to/dsh-translate-on-select"

link: is a symlink installation; code changes take effect immediately (frontend hard refresh required; host changes require restarting the client). After moving or renaming the directory, you need to run add again.

You Must Restart the Client Once After Installation

The injection line in webserver/index-inject is collected once at host startup and does not hot-reload. Simply refreshing the page is not enough — you need to restart DeepSeek Harness once.

Self-check after restart:

  1. No persistent icon in the bottom-right corner is normal (this plugin does not provide a tray icon).
  2. Select an English passage in any assistant reply; a translation card should appear below the selection.
  3. If there is no response: check the Console in developer tools for /dsh-translate/client.js; in Network, that request should return 200.

Configuration

Config file path: $DSH_HOME/.dsh-translate.json (on Windows this defaults to C:\Users\<you>\.dsh\.dsh-translate.json); it is created on first modification:

{
  "to": "zh-Hans",
  "enabled": true
}
Field Description
to Target language. Defaults to zh-Hans (Simplified Chinese); also supports BCP-47 codes such as zh-Hant, en, ja, etc., and can be used as a reverse dictionary.
enabled Set to false to turn off translation entirely (the plugin is still loaded, but the API returns “disabled”).

Changing the configuration does not require a restart; the file is re-read on each request.

Optional environment variables:

Variable Purpose
DSH_TRANSLATE_CONTACT MyMemory contact email; anonymous usage is about 5000 characters/day, and filling this in can raise it to about 50,000.
DSH_TRANSLATE_TRUSTED_HOSTS Comma-separated; only used when the host trust barrier is unavailable and DSH is placed behind a reverse proxy / LAN.

Typical Usage

  1. Install as described above and complete one restart.
  2. In a DSH conversation or any injected page, use the mouse to drag-select a piece of non-purely-Chinese text.
  3. Release and wait about 200ms, then read the translation in the card below the selection; you can copy it or click re-translate as needed.
  4. If you mainly need Traditional Chinese or English-to-something translation, edit the to field in .dsh-translate.json and then select text again.

The plugin runs with the permissions of the current dsh process; before installing, it is recommended to review the repository source code and the MIT license to confirm it meets your environment policy.

Security, Privacy, and Limitations

Security and Privacy

  • The route has a trust barrier (same-origin / host delegation / fail-closed); when the host barrier is absent, only loopback addresses or hosts listed in DSH_TRANSLATE_TRUSTED_HOSTS are allowed through.
  • Selected content will be sent to public free APIs (cn.bing.com, and MyMemory if necessary). Do not use it for keys, private data, or unpublished code.

Known Limitations

  • Long text is chunked by 4000 characters for translation and then concatenated; line breaks may not exactly match the original.
  • Short sentences take about 0.7–1.4s to translate; text at around the 2000-character level takes about 4s; there is no streaming output.
  • The stability of public APIs is outside the plugin’s control; changes to Bing tokens or page structure may cause it to fail; when both backends fail, a failure card is displayed and can be retried.
  • The card collapses when scrolling or zooming the window; selections exceeding 20000 characters are not translated.

Uninstall

dsh plugin --profile desktop remove dsh-translate-on-select

Then restart the client.

Conclusion

dsh-translate-on-select brings select-to-translate into the DSH page: select, wait briefly, read the card — it is suitable for quickly viewing translations during assistant conversations and documentation reading. Before using it, please accept the privacy and accuracy boundaries of public translation APIs, and restart the host as required after installation.

  • Community directory page: https://www.skillhub.cn/plugins/syzke/dsh-translate-on-select
  • Source code and full documentation: https://github.com/syzke/dsh-translate-on-select
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye