Repolode
Realmagnum

Realmagnum/opencode-translate-selection

An OpenCode plugin that shows an inline translation tooltip when you select text in OpenCode Desktop or the terminal UI.

Stars
1
Forks
0
Open issues
0
Last commit
2 days ago

What is it?

opencode-translate-selection is a plugin for OpenCode that translates text as you select it. In OpenCode Desktop, a floating tooltip appears above the Quote toolbar with the translation. In the terminal UI, hotkeys and slash commands open a scrollable translation modal or a persistent side panel.

Translation uses a hybrid routing approach. Short words and phrases go to Google Translate with a MyMemory fallback, while multi-line selections such as bullet lists, numbered steps, and code are sent to the active session's LLM through client.session.generate, so they do not add messages to the chat. If the LLM times out or is busy, requests fall back to the machine translation pipeline, with placeholder tokens protecting code and identifiers.

Users can set target languages, choose an engine mode (Auto, Fast MT only, or Session LLM only), adjust the LLM timeout, and pick color themes and tooltip geometry in the Translation settings page. Selections inside the integrated terminal are not supported because it renders to a canvas.

Key features

  • 01Shows a translation tooltip automatically after text selection in OpenCode Desktop.
  • 02Routes simple phrases to Google Translate and structured text or code to the session LLM.
  • 03Provides hotkeys and slash commands for translating clipboard text and the last assistant message in the TUI.
  • 04Offers a scrollable modal and a persistent side panel with keyboard navigation.
  • 05Supports configurable target languages, engine modes, and visual themes.
  • 06Copies translations to the clipboard on Windows, macOS, and Linux.

Use cases

  • Reading English documentation or code explanations in a non-English language while working in OpenCode.
  • Translating long assistant replies in the terminal into a side panel for side-by-side reading.
  • Quickly checking the meaning of a foreign word or phrase in a chat without leaving the session.

Quick start

  1. 1

    Install the plugin from GitHub with the OpenCode CLI

    opencode plugin add github:Realmagnum/opencode-translate-selection
  2. 2

    Restart OpenCode Desktop after installation

Things to know

  • Requires OpenCode v2.2.0 or newer.
  • Desktop and terminal features are documented; the README does not describe other editors or platforms.

In collections

Topics

FAQ

What is opencode-translate-selection?
An OpenCode plugin that shows an inline translation tooltip when you select text in OpenCode Desktop or the terminal UI. opencode-translate-selection is a plugin for OpenCode that translates text as you select it. In OpenCode Desktop, a floating tooltip appears above the Quote toolbar with the translation. In the terminal UI, hotkeys and slash commands open a scrollable translation modal or a persistent side panel.
Is opencode-translate-selection free to use? What license does it have?
opencode-translate-selection is open source under the MIT license. Check the license terms before using it in commercial products.
Is opencode-translate-selection still maintained?
Actively maintained. The last commit to opencode-translate-selection was on Nov 5, 2026.
What can I use opencode-translate-selection for?
Reading English documentation or code explanations in a non-English language while working in OpenCode. Translating long assistant replies in the terminal into a side panel for side-by-side reading. Quickly checking the meaning of a foreign word or phrase in a chat without leaving the session.
How do I install opencode-translate-selection?
Install the plugin from GitHub with the OpenCode CLI: opencode plugin add github:Realmagnum/opencode-translate-selection Restart OpenCode Desktop after installation
Where can I get opencode-translate-selection?
The source code and installation instructions are on GitHub: https://github.com/Realmagnum/opencode-translate-selection

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects