DeepSeek Harness Plugin: Text Selection Translation

Introduction

In a DeepSeek Harness conversation, select any piece of text. A small dot appears at the bottom-right corner of the selection (displayed as “T” in the Chinese interface and “A” in the English interface). Click it, and a translation popup appears below the dot. This capability is provided by the yyyl99/dsh-selection-translate plugin, addressing the need to quickly look up translations, definitions, and example sentences.

What Is This

This is a selection-based translation plugin developed by maintainer Yyyl99. It does not automatically translate any content, and the popup does not modify the conversation. Selecting text within the popup will not trigger a new translation. Translation direction supports Auto (Chinese to English, everything else to Chinese), Chinese, and English. Once you manually pick a direction, it will be remembered.

Core Features

1. Full-Sentence Translation

  • Source text + translation (English–Chinese bidirectional)
  • The top row lets you switch between “Auto / Chinese / English” direction; the top-right corner has a read-aloud button and a close button
  • Click outside the popup, press Esc, or scroll the selection out of the viewport to dismiss the popup

2. Word Dictionary Lookup

  • Displays the headword and phonetic transcription
  • Up to two Chinese definitions per part of speech
  • One bilingual example sentence under each part of speech
  • Prioritizes the dictionary’s own sentences, picking ones that semantically match the given part of speech; for parts of speech still lacking an example, the current window’s model generates one (marked with an AI badge)

3. Read Aloud

  • A small speaker icon appears after each English segment; click it to read that segment aloud (source text, translation, or headword)
  • Prefers the window’s built-in speech synthesis; if no usable voice is available in the window, it falls back to the host reading aloud via Windows SAPI
  • The segment currently being read has its speaker icon turned into a stop square; clicking another segment will stop the previous one first

4. Code Identifier Handling

  • For code identifiers like diagKey that machine translation would return unchanged, the plugin splits them into constituent words, translates each part, and lists the definitions in a compact word-card format

5. UI & Privacy

  • The popup is an opaque card: dark background with one step of lightness boost, 1px border, 14px border radius, a larger drop shadow, a small caret at the top pointing to the dot, and at least 20px clearance from window edges
  • Height adapts to content; internal scrolling only occurs when content overflows the window
  • Translations are sent to Bing (edge.microsoft.com); dictionary lookups go to Youdao (dict.youdao.com), with a fallback to dictionaryapi.dev if the word is not found
  • The selected text is never written to disk; locally, only the direction preference and a small diagnostic log for troubleshooting are stored (%TEMP%/dsh-selection-translate.log, logging timestamps, stages, and dimensions only—no text content)

6. Token Consumption & Caching

  • During a dictionary lookup, if the dictionary’s own example sentences are insufficient to cover every part of speech displayed on the card, the plugin uses the model currently active in the window to generate an English example sentence (along with its Chinese meaning) for the missing part of speech. Such sentences carry an AI badge on the card
  • The model is only invoked when “a matching sentence cannot be found in the dictionary corpus for that part of speech”; if the corpus is sufficient, zero model requests are made
  • Per-request scale: a single request contains the headword, the definitions shown on the card, and a few candidate example sentences—roughly 500–800 input tokens, 100–200 output tokens
  • Caching: results for the same word + same set of definitions are kept in memory for 1 hour; repeated lookups of the same word won’t incur duplicate charges; the cache is cleared on process restart
  • Which model is used: it follows the model currently selected in the window (the provider/model chosen in settings). No additional API key configuration is required, and no extra billing is directed elsewhere
  • To disable this feature: switch the window’s model to an unavailable one. The plugin will silently skip the sentence generation and only display the dictionary’s existing example sentences (no AI badge on the card). Translation and read-aloud remain unaffected

Installation & Enablement

Search for selection translate in the Plugin Marketplace / Discover, or open the Plugins page and enter the following in the add-plugin input field:

github:Yyyl99/dsh-selection-translate

On machines with the DSH CLI already installed, you can also run:

dsh plugin add github:Yyyl99/dsh-selection-translate

Install once, and it works on both Desktop and dsh web.

Typical Usage

  1. Use the mouse to select a sentence or an English word in the conversation;
  2. A small dot appears at the bottom-right of the selection—click it;
  3. The popup expands below the dot;
  4. The top row lets you switch between “Auto / Chinese / English” direction; the top-right has read-aloud and close;
  5. Click outside the popup, press Esc, or scroll the selection out of the viewport to dismiss it.

Applicable Scenarios & Notes

  • Ideal for users who need to look up words, browse example sentences, and listen to pronunciation while reading a conversation
  • The plugin runs with the current dsh process’s permissions; it is recommended to review the source code and license before installing
  • Sentence completion depends on the model currently selected in the window; if the window’s model is unavailable, the sentence completion feature will be silently skipped

In Brief

The plugin pops up a compact window after you select text, offering full-sentence translation, dictionary-style word lookup with bilingual example sentences, read-aloud support, and direction memory—all while balancing privacy and token costs. See details: https://www.skillhub.cn/plugins/Yyyl99/dsh-selection-translate https://github.com/Yyyl99/dsh-selection-translate

羽毛球分组比赛记分
小程序二维码

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

Xiaoye