Translate Anywhere - Select & Hover Translator
English | 简体中文
Select text in VS Code's Chat, Markdown preview, Release Notes, Settings, extension pages and other built-in pages. A small red dot appears next to the selection; hover it for an instant translation. Single words come from an offline dictionary; phrases, sentences and paragraphs are translated by the AI model you choose: GitHub Copilot through VS Code, or OpenAI, Claude, Gemini, DeepSeek, Qwen and other providers with your own API key. No Copilot and no key? Use the token-free online engine instead.
Press Alt+Z to translate the paragraph under the mouse, or Alt+W to translate the whole page while keeping its links, buttons and layout.
Text editors are never touched. The extension does nothing while you edit code.

Inspired by the reading experience of the Immersive Translate browser extension. Not affiliated with or endorsed by it. The screenshots are rendered from the extension's real UI on demo pages.
What's new
- 0.7.1: Full-page translation keeps the page intact. Links, clickable settings such as
workbench.browser.enableRemoteProxy, inline code, the Release Notes In this update contents, checkboxes and buttons stay in place and keep working after Alt+W; pressing it again restores the page exactly. See the changelog.
- 0.7.0: no Copilot and no API key? Choose Online (no API key) as the Translation engine in the sidebar. It uses Google Translate (experimental) or MyMemory, after a one-time permission for each service. Without a Copilot / VS Code model, AI mode offers this switch itself. Dictionary hits stay local; everything else uses only the engine you selected. Existing installations keep AI. See setup, research, privacy and limitations.
Getting started
- Install the extension.
- Click Enable… in the welcome notification, or Enable / Repair in the Translate Anywhere sidebar (the 文A icon in the Activity Bar). Read the disclosure, then confirm. Why is this needed?
- Reload the window when prompted.
- Click Try it on a sample page in the sidebar, or select some text in Chat or a Markdown preview, then hover the red dot.
- Pick a translation engine. The default is AI through VS Code language models: the extension picks a visible lightweight model (luna, haiku, flash, mini…), and the first AI translation asks for permission to use it. If you dismissed that prompt, click Allow access next to the model in the sidebar.
Features
| Feature |
How |
| Select & hover translation |
Select text, then hover the red dot. Words use the offline dictionary. Dictionary misses use the selected AI or online engine; offline-only mode never sends them. |
| Paragraph translation |
Hover a paragraph and press Alt+Z. Press again to remove the translation. When you select a long passage, the popup shows a one-line hint about this shortcut (a few times at most). |
| Full-page translation |
Press Alt+W to translate the Chat conversation, preview or page you are working in; press again to restore. Links, setting buttons, code, contents navigation and other controls keep working. "Translation only" (default) or "bilingual" display. |
| Three engines |
AI (Copilot or your own API key), token-free online translation (Google Translate or MyMemory), or the offline dictionary only. |
| Many AI providers |
VS Code language models (GitHub Copilot, no key needed), OpenAI, Anthropic Claude, Google Gemini, DeepSeek, Qwen, Kimi, GLM, SiliconFlow, OpenRouter, Groq, Mistral, Ollama, or any OpenAI-compatible endpoint. |
| Settings sidebar |
Everything in one panel: shortcuts with a sample page to try them, engines, models, API keys, vocabulary and dictionary. |
| Markdown as preview |
One click in the sidebar makes .md files open as a rendered preview by default, which is easier to read and translate. Open as text again undoes it. |
| Vocabulary book |
Click ☆ in the popup to save a word or sentence. Open, export to CSV or remove entries from the sidebar. |
| Your language |
20 target languages; the UI follows your VS Code display language. |
| Dictionary |
AI translation |
 |
 |
| Chat |
Full page (Alt+W) |
 |
 |
Supported surfaces
Each surface can be switched off with translateAnywhere.surfaces (sidebar footer → Where to translate…):
- Markdown preview
- Release Notes
- Chat (responses, the question box shown when an agent asks you something, tool confirmations and input notices)
- Settings and Keyboard Shortcuts editors
- Extension details pages (README and changelog)
- Welcome page and walkthroughs
- Notifications, dialogs, workbench hover cards, the Workspace Trust page and view messages
Full-page translation keeps the page working
- Translation only replaces the text in place around the page's own elements. Links, clickable settings, inline code, keys and icons are the original elements, so they look and behave exactly as before. The Release Notes contents keep highlighting the section you are reading.
- Bilingual adds a translated copy under each paragraph. Links in the copy work, clickable controls forward to the original, and state such as the current contents entry follows the original.
- Code blocks, editors, inputs and text already in your target language are left alone. Paragraphs are translated as they scroll into view, including content that appears later.
- If an engine returns a paragraph without its format markers, that paragraph is shown bilingually instead, so the original links are never lost.
Translation engines
Choose the engine under Translation in the sidebar (translateAnywhere.translation.engine). Dictionary hits are always answered locally.
AI (default)
| Provider |
API |
Default (lightweight) model |
Get a key |
| VS Code language models (default) |
VS Code Language Model API |
a visible lightweight model (luna, haiku, flash, mini…) |
none; uses e.g. your GitHub Copilot subscription |
| OpenAI |
OpenAI |
gpt-4o-mini |
platform.openai.com |
| Anthropic Claude |
Anthropic Messages |
claude-haiku-4-5 |
console.anthropic.com |
| Google Gemini |
OpenAI-compatible |
gemini-2.5-flash-lite |
aistudio.google.com |
| DeepSeek |
OpenAI-compatible |
deepseek-chat |
platform.deepseek.com |
| Alibaba Qwen (DashScope) |
OpenAI-compatible |
qwen-flash |
bailian.console.aliyun.com |
| Moonshot Kimi |
OpenAI-compatible |
moonshot-v1-8k |
platform.moonshot.cn |
| Zhipu GLM |
OpenAI-compatible |
glm-4-flash |
open.bigmodel.cn |
| SiliconFlow |
OpenAI-compatible |
Qwen/Qwen2.5-7B-Instruct |
cloud.siliconflow.cn |
| OpenRouter |
OpenAI-compatible |
openai/gpt-4o-mini |
openrouter.ai |
| Groq |
OpenAI-compatible |
llama-3.1-8b-instant |
console.groq.com |
| Mistral AI |
OpenAI-compatible |
mistral-small-latest |
console.mistral.ai |
| Ollama (local) |
OpenAI-compatible |
qwen2.5:3b |
no key; runs on http://localhost:11434 |
| Custom |
OpenAI-compatible |
(you set it) |
any compatible endpoint: LM Studio, vLLM, one-api, an Azure gateway… |
VS Code language models
- The model list shows the user-selectable models available for translation, in VS Code's order. Copilot models follow the current Chat session's visibility, including Copilot SDK Chat; internal helpers and session-only proxies are excluded. Visibility changes refresh while the sidebar is open.
- There is no Auto choice. Copilot's own Auto router is excluded too, because it can route to models you hid.
- A saved model that you hide later stays selected and is marked hidden. A saved model that is no longer selectable is marked not available and disabled until you choose another.
- Speed test warms up each model once, times three runs and shows the median. The fastest lightweight model then picks the ones suited to translation as Recommended, with Use it. It only runs when you click it; requests to premium models count toward your Copilot premium-request quota, so hide models you never use in VS Code's Language Models view.
API providers
- Fetch list loads the provider's model list; you can also type any model name. Model names change often: if a default stops working, pick another.
- Base URL overrides the endpoint, for proxies, regional endpoints such as
https://dashscope-intl.aliyuncs.com/compatible-mode/v1, or self-hosted gateways.
- Only lightweight models are suggested by default: translation needs speed, not reasoning.
- API keys are stored with VS Code's encrypted Secret Storage, one per provider. They are never written to
settings.json and are not synced. Set or clear them with Set key in the sidebar or Translate Anywhere: Set API Key.
Online (no API key)
- Google Translate: experimental, unofficial endpoint; not the supported Cloud API.
- MyMemory: documented anonymous API, 5,000 characters per day.
- Each service needs a one-time local permission, which you can revoke. Source language defaults to automatic detection. There is no automatic fallback to another service or to AI.
- Details, setup and privacy notes: docs/ONLINE-TRANSLATION.md.
Offline dictionary
Word lookups use ECDICT for English → Chinese (770,000 entries, 15 MB compressed) and a dictionary derived from HanDeDict for German → Chinese. Choose Offline dictionary only as the engine to never send text anywhere. There are three ways to get the dictionaries:
| Option |
How |
| Automatic download (default) |
On first use the dictionary is downloaded once, from GitHub Releases with jsDelivr and raw.githubusercontent mirrors as fallbacks, and checked with SHA-256. Until it is ready, every selection uses the selected engine. |
| Offline VSIX |
Download vscode-translate-anywhere-offline-<version>.vsix (one package for every platform) from GitHub Releases and run Extensions: Install from VSIX…. No network access is needed. |
| Local file |
Click Choose file… in the sidebar (or set translateAnywhere.dictionary.path) to use a dictionary.json.gz you downloaded or built yourself with tools/build.py. |
Behind a firewall, set translateAnywhere.dictionary.downloadUrl to an internal HTTPS mirror of the same file. Set translateAnywhere.dictionary.autoDownload to false to never download.

Click the 文A icon in the Activity Bar. The sidebar shows:
- Integration status, with Enable / Repair and Disable & Restore.
- Shortcuts & how to use: what select, Alt+Z and Alt+W do, and Try it on a sample page.
- Click the dot to customize it: size, color, border, opacity, shape, or your own image (PNG, JPG, GIF, WebP, SVG), with a live preview.
- Click a key and press a new combination to change it; Backspace turns it off.
- A card offers to open Markdown files as a preview by default.
- Translation: engine (AI / online / offline only), target language, full-page display mode, automatic dictionary-miss translation.
- Online translation (when selected): service, source language, privacy disclosure, local permission and revocation.
- AI engine (when selected): provider, model with Speed test or Fetch list, API key status with a link to the provider's key page, and an optional base URL.
- Vocabulary: your five latest entries; Show N more unfolds the rest in place (the full list opens in an editor); open, export, remove.
- Offline dictionary: status, Download, Choose file, Use default.
- Footer: Where to translate… (per-surface switches), all settings, log.
Configuration values appear in Settings → Extensions → Translate Anywhere and sync with Settings Sync; links there jump to the matching control in the sidebar. API keys stay in VS Code's Secret Storage. Online-service permissions are separate local profile state, not synchronized settings.
How it works (please read)
VS Code does not give extensions an API to read selections or draw popups inside Chat, Release Notes, Settings or the built-in Markdown preview. To make this possible, the extension adds a small script to VS Code's own UI files:
out/vs/workbench/workbench.desktop.main.js
out/vs/code/electron-browser/workbench/workbench.html
- the webview
index.html
- the matching
checksums in product.json
Safeguards:
- Nothing is changed until you explicitly enable the integration (
translateAnywhere.integration.enabled defaults to false).
- Original files are backed up byte-for-byte in the extension's global storage. The patch is applied atomically and refuses to overwrite files it did not write.
- Disable and Restore VS Code restores the originals. The restore also runs automatically when the extension is uninstalled, after VS Code restarts.
- After a VS Code update replaces the files, the integration is reapplied automatically (
translateAnywhere.integration.autoRepair).
- If the VS Code installation folder is not writable by you, each patch operation asks for administrator confirmation once: UAC on Windows, the system password dialog on macOS, the polkit (
pkexec) dialog on Linux. No persistent service or scheduled task is created, and the files the extension keeps are handed back to your user account.
- Because checksums are updated, VS Code does not report a "corrupt installation". After disabling, the warning may appear once until VS Code is fully restarted.
Settings
| Setting |
Default |
Description |
translateAnywhere.targetLanguage |
zh-CN |
Language to translate into. |
translateAnywhere.uiLanguage |
auto |
Popup, sidebar and message language. auto follows VS Code. |
translateAnywhere.surfaces |
all on |
Enable or disable each supported surface. |
translateAnywhere.shortcuts.paragraph |
Alt+Z |
Paragraph shortcut. Empty disables it. |
translateAnywhere.shortcuts.fullPage |
Alt+W |
Full-page shortcut. Empty disables it. |
translateAnywhere.dot.size / color / borderWidth / borderColor / opacity / shape |
7 / #e5484d / 1 / #ffffff / 0.85 / circle |
Look of the selection dot. Easier from the sidebar: click the dot. |
translateAnywhere.fullPage.mode |
translationOnly |
translationOnly or bilingual. |
translateAnywhere.translation.engine |
ai |
ai, online, or offline. Dictionary hits stay local. |
translateAnywhere.online.provider |
google |
Experimental google or documented anonymous mymemory; separate local permission required. |
translateAnywhere.online.sourceLanguage |
auto |
Automatic detection (both services) or an explicit source language. |
translateAnywhere.ai.autoTranslate |
true |
Use the selected engine automatically when the dictionary has no entry; ignored in offline-only mode. |
translateAnywhere.ai.provider |
vscode |
AI provider (see the table above). |
translateAnywhere.ai.modelId |
(empty) |
VS Code language model ID. Filled in with a visible lightweight model on first use. Run Speed test in the sidebar for AI-recommended models. |
translateAnywhere.ai.apiModel |
(empty) |
Model for API providers. Empty means the provider's default. |
translateAnywhere.ai.baseUrl |
(empty) |
Endpoint override for API providers. |
translateAnywhere.dictionary.autoDownload |
true |
Download the dictionary on first use. |
translateAnywhere.dictionary.path |
(empty) |
Use a local dictionary file. |
translateAnywhere.dictionary.downloadUrl |
(empty) |
Extra HTTPS mirror tried first. |
translateAnywhere.integration.enabled |
false |
Consent for the UI integration described above. |
translateAnywhere.integration.autoRepair |
true |
Reapply after VS Code updates. |
Changes apply within a few seconds without reloading.
About shortcuts. The paragraph and full-page shortcuts are handled inside the page itself, so they are configured in the sidebar or the settings above rather than in Keyboard Shortcuts.
- Format: modifiers joined with
+ and one key, such as Alt+Z, Ctrl+Shift+Y or F8.
- Supported keys: letters, digits, F1–F24,
Space and `.
- When the mouse is not over a supported page, the key keeps its normal VS Code meaning; for example,
Alt+Z toggles word wrap in an editor.
Commands
All commands are under Translate Anywhere: in the Command Palette. Most are also buttons in the sidebar.
| Command |
Purpose |
| Enable / Repair Integration · Disable and Restore VS Code |
Apply, repair or remove the UI integration. |
| Select AI Provider · Select AI Model · Set API Key · Authorize AI Model |
Configure the AI engine. |
| Allow Online Translation Service · Revoke Online Translation Permission |
Manage local permission for the selected online service. |
| Download Dictionary · Use Local Dictionary File… · Use Default Dictionary |
Manage the offline dictionaries. |
| Try It on a Sample Page · Open Markdown Files as Preview by Default · Open Markdown Files as Text by Default · Choose Where to Translate |
Getting started and reading comfort. |
| Open Vocabulary · Export Vocabulary to CSV · Remove Vocabulary Entries |
Manage saved words. |
| Open the Sidebar · Open Settings · Show Status · Show Log |
Settings and diagnostics. |
Privacy
- No telemetry. The extension collects and sends no usage data.
- Dictionary lookups are offline. The only dictionary-related network access is the one-time downloads described above. The offline VSIX and the local-file option need none.
- AI translation sends only the selected text, or the paragraph or page being translated, to the provider you selected:
- VS Code language models are called through VS Code's Language Model API, and that provider's terms apply (for example GitHub Copilot's).
- API providers are called directly over HTTPS with your key, and their terms and data policies apply.
- Ollama and other local endpoints keep everything on your machine.
- Turn off
translateAnywhere.ai.autoTranslate to require the popup's translate button on dictionary misses. Paragraph/page shortcuts still explicitly request translation.
- Online translation sends text directly to the chosen service only after local per-service consent. Google is unofficial/experimental. MyMemory allows 5,000 anonymous characters/day and may retain submitted text and share it with translation partners. HTTPS query parameters can appear in service/proxy logs. Never send confidential text or code; revocation cannot recall text already sent. No silent fallback to other services or AI.
- Offline dictionary only disables AI and online translation; dictionary downloads are still governed separately by the dictionary settings.
- Paragraph and page translation send the visible text with short numbered markers such as
<g1>…</g1> where links and other inline elements sit. Link targets, code and setting IDs are not sent.
- The UI talks to the extension through an HTTP bridge bound to
127.0.0.1 only. It is protected by a random per-installation token and checks the request origin.
- Your vocabulary is stored locally in VS Code's global storage folder for this extension.
Troubleshooting
| Symptom |
What to do |
| No red dot appears |
Check the sidebar's integration status and click Enable / Repair, then reload the window. Make sure the surface is on under Where to translate…. |
| Alt+Z / Alt+W does nothing |
Move the mouse over the page or Chat answer first; elsewhere the key keeps its VS Code meaning. Check the shortcuts in the sidebar. |
| AI translation fails |
Click Allow access next to the model, choose another model, or switch to the online engine. Show Log has the details. |
| A paragraph shows original and translation after Alt+W in "translation only" mode |
The engine dropped the paragraph's format markers, so it was shown bilingually to keep its links. Try another model or service. |
| VS Code warns about a "corrupt installation" after disabling |
Fully quit and restart VS Code once. |
Requirements and limitations
- Windows (x64, ARM64), macOS (Apple Silicon, Intel) and Linux (x64, ARM64, ARMhf). Desktop VS Code Stable 1.100 or newer; Insiders usually works too.
- macOS: Option works as Alt, so the default shortcuts are Option+Z and Option+W. Run VS Code from /Applications: when it runs from Downloads or a mounted disk image, macOS starts it from a read-only copy (App Translocation) that cannot be integrated. Modifying the app bundle invalidates its code signature seal; VS Code still starts normally, and Disable restores the original files.
- Linux:
.deb/.rpm installs under /usr/share/code need a polkit agent for the administrator prompt (present on standard desktops). If none is available, the extension offers a terminal command to copy. Snap and Flatpak installations are read-only and cannot be integrated; use the .deb, .rpm or .tar.gz build instead.
- Not available in VS Code for the Web or Codespaces browser sessions. In remote windows (SSH, WSL, containers) the extension runs on your local machine as a UI extension.
- Requires write access to the VS Code installation folder. For system-wide installs this means administrator confirmation.
- The bridge uses local port
17865. If several users of the same computer run VS Code at the same time, only the first one gets translations.
- VS Code UI changes in future releases can break individual surfaces until the extension is updated.
- Offline dictionary lookups translate into Chinese only. Other target languages require the selected AI or online engine.
- Online providers may be blocked or rate-limited on your network. Google has no supported anonymous API contract; MyMemory's small quota is unsuitable for heavy full-page use.
Uninstalling
Uninstalling restores VS Code's original files after the next full restart. To restore immediately, click Disable & Restore in the sidebar (or run Disable and Restore VS Code) before uninstalling. If enabling needed administrator confirmation, always do this first: the automatic restore after uninstalling runs without administrator rights. Reinstalling or updating VS Code also removes the integration.
Contributing
Issues and pull requests are welcome at github.com/MusingZone/vscode-translate-anywhere. See CONTRIBUTING.md for the development setup and how to add an interface language.
- Tests:
npm test (unit), python tools/ui-dom-test.py and python tools/panel-test.py (headless Chrome, needs pip install playwright).
- Packages:
npm run package.
If the extension helps you, a rating on the Marketplace helps others find it.
Credits
License
Extension code: MIT. The German–Chinese dictionary data (data/dictionary-de.json.gz) is licensed under CC BY-SA 3.0.
| |