LLM Translate
pendingby tsingfenger
Translate selected text using LLM via OpenAI-compatible API.
中文 | English
LLM Translate
An Obsidian plugin that translates selected text using any OpenAI-compatible LLM API.
Features
- Multiple trigger modes — hotkey, right-click context menu, or auto-translate on text selection
- Works in both editing and reading mode
- Replace or Copy — replace selected text directly in editing mode, or copy the translation in reading mode
- Draggable & resizable popover — translation results are shown in a floating panel with Markdown rendering support
- Any OpenAI-compatible API — works with OpenAI, Azure OpenAI, Gemini, Claude, local models (Ollama, LM Studio), or any service exposing a
/v1/chat/completionsendpoint - Customizable system prompt — full control over translation behavior (language pairs, tone, terminology preservation, etc.)
Installation
From Community Plugins (coming soon)
- Open Settings → Community plugins → Browse
- Search for LLM Translate
- Click Install, then Enable
Manual Installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Create a folder
obsidian-llm-translateinside your vault's.obsidian/plugins/directory - Copy the downloaded files into the folder
- Restart Obsidian and enable the plugin in Settings → Community plugins
Configuration
Open Settings → LLM Translate to configure:
| Setting | Description | Default |
|---|---|---|
| API URL | OpenAI-compatible API base URL | https://api.openai.com |
| API Key | Your API key | — |
| Model | Model name | gpt-4o-mini |
| Temperature | Controls randomness (0–2) | 0.3 |
| System Prompt | Instructions sent to the LLM | Auto-detect language, translate between Chinese and English |
| Auto-translate | Translate on text selection automatically | Off |
| Auto-translate delay | Delay (ms) before auto-translate triggers | 500 |
Use the Test button in settings to verify your API connection.
Usage
Hotkey
- Select text in any markdown view
- Open the command palette and run LLM Translate: Translate selection, or bind it to a hotkey in Settings → Hotkeys
Right-click Menu
Select text → right-click → Translate selection
Auto-translate
Click the Languages icon in the left ribbon (or toggle in settings) to enable auto-translate. Once enabled, any text selection will automatically trigger translation after a short delay.
Popover Actions
- Copy — copy the translation to clipboard
- Replace — replace the selected text with the translation (editing mode only)
- Drag the header to move the popover
- Drag the bottom-right corner to resize
- Press
Escor click outside to dismiss
Build from Source
npm install
npm run build
For development with auto-rebuild:
npm run dev
License
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.