dsh-selection-translate

Select text in the DSH web client and a translate button appears at the end of the selection; clicking it translates that text in place. Translation goes through the host llm service, so it reuses the model the current session already has selected and needs no separate API key; an OpenAI-compatible endpoint can be configured instead. The result opens in a popover that stays inside the viewport, with one-click copy, a row of language buttons for instant retranslation, and smart Chinese-to-English / other-to-Chinese as the default. Configuration is stored host-side and its API key is never sent to the browser.

Overview

Select text in the DSH web client and a translate button appears at the end of the selection; clicking it translates that text in place. Translation goes through the host llm service, so it reuses the model the current session already has selected and needs no separate API key; an OpenAI-compatible endpoint can be configured instead. The result opens in a popover that stays inside the viewport, with one-click copy, a row of language buttons for instant retranslation, and smart Chinese-to-English / other-to-Chinese as the default. Configuration is stored host-side and its API key is never sent to the browser.

Installation

Install from npm

dsh plugin --profile web add dsh-selection-translate

Resolves a published tarball rather than cloning the repository, and installs without any extra setup. Swap `web` for your profile name if you run another one.

Install from GitHub

dsh plugin --profile web add github:huanleyabo/dsh-selection-translate

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.

Installation notes

  • May run terminal commands