Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Hover TranslatorNew to Visual Studio Code? Get it now.
Hover Translator

Hover Translator

NoTeNo

|
501 installs
| (1) | Free
Translate text and words on hover with support for multiple formats and languages
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Hover Translator

VS Code extension that translates the word, string literal or selection under your cursor, without turning your editor into a request firehose.

Features

  • Hover translation — rest the pointer on a word to see it in your language.
  • Smart identifier handling — recognises snake_case, camelCase, PascalCase, kebab-case, Title Case and UPPER_SNAKE_CASE, including acronym runs such as parseURLValue, userID and API_V2.
  • String literal translation — hover inside '…', "…" or `…` to translate its contents.
  • Block translation — select a region and hover it, or run Translate Selected Block to replace or copy the result. Reserved words and identifiers are protected so the code still compiles; comments and strings are translated as prose.
  • Offline dictionary — common programming words resolve locally with no network request at all (Vietnamese today).
  • Six translation backends — DeepL, Google Cloud Translation, Azure AI Translator, LibreTranslate (self-hostable) and two keyless public endpoints, with automatic fallback.
  • 11 languages — English, Vietnamese, French, German, Spanish, Italian, Portuguese, Russian, Chinese, Japanese, Korean.

Privacy: read this first

Translating means sending the hovered text to a translation service. On first run the extension asks once before it sends anything, and stays inactive until you accept.

Setup Where your text goes
No API key (default) translate.google.com and api.mymemory.translated.net. Public endpoints that may log or retain submissions — MyMemory in particular may add them to a shared translation memory.
DeepL / Google Cloud / Azure key That vendor only, under your own account and its terms.
Self-hosted LibreTranslate Nowhere outside your network.

Only the text you hover over is sent, never the whole file. Files matching hoverTranslator.excludeFilePatterns are skipped entirely; the default list covers .env, *.pem, *.key, id_rsa*, secrets.*, node_modules/** and other generated files.

For anything proprietary, configure an API key or self-host LibreTranslate.

Avoiding Too many requests

Keyless public endpoints are rate limited per IP, so the extension is built to send as few requests as possible. Layers, in order — a request only leaves the machine if it survives all of them:

Layer What it stops
Debounce (hoverDelay, 250ms) + hover cancellation Requests for words you merely swept the pointer across. In a 30-word sweep this is the difference between 30 requests and 1.
Pre-filters Numbers, symbols, 1–2 character tokens, reserved words, and text already written in the target language.
Offline dictionary Most identifier hovers, with no request whatsoever.
Translation cache Anything looked up before (30 days by default, persisted to disk).
Negative cache Re-asking for something that just failed (10 minutes).
In-flight coalescing Duplicate concurrent hovers of the same text.
Bounded queue + per-minute budget Bursts. The queue holds 5 requests and drops the oldest; the budget caps 20 requests per rolling minute.
Escalating per-provider cooldown Hammering a provider that already answered 429. Backoff is 1m → 5m → 15m → 60m with jitter, honours Retry-After, and survives a window reload.

If it still happens, the reliable fix is a key: Hover Translator: Set Translation API Key. DeepL's free tier allows 500k characters a month, which is far beyond what hovering consumes.

When every provider is cooling down, the status bar shows ⚠ Translate (5m); hover over it for a full breakdown, or run Hover Translator: Show Status.

Usage

  1. Hover a word, identifier or string literal.
  2. Select a region and hover it to translate the whole block.
  3. Run Hover Translator: Translate Selected Block to replace or copy the result. When the selection is a single identifier, the replacement is folded back into the original casing (user_name → ten_nguoi_dung) so the code stays valid.
  4. Click the status bar to toggle the extension or change the target language.

Commands

Command Purpose
Hover Translator: Toggle Hover Translation Turn hover translation on or off
Hover Translator: Select Translation Language Change the target language
Hover Translator: Translate Selected Block Translate the selection, then replace or copy
Hover Translator: Set Translation API Key Store a key in VS Code's secret storage
Hover Translator: Clear Translation Cache Drop cached translations and provider cooldowns
Hover Translator: Show Status Print providers, queue, budget and cache stats to the log
Hover Translator: Show Logs Open the extension's log output channel

Settings

Basics

Setting Default Description
hoverTranslator.enabled true Translate on hover (also requires accepting the privacy notice)
hoverTranslator.targetLanguage Vietnamese Target language
hoverTranslator.translateIdentifiers true Translate the word under the cursor
hoverTranslator.translateStringLiterals true Translate string literal contents
hoverTranslator.useOfflineDictionary true Resolve common words locally
hoverTranslator.excludeFilePatterns see package.json Files where translation never runs

Provider

Setting Default Description
hoverTranslator.provider auto auto, deepl, google-cloud, azure, libretranslate, free, google-free, mymemory
hoverTranslator.apiKey "" Discouraged plaintext fallback — prefer the Set Translation API Key command
hoverTranslator.azureRegion "" Required for Azure, e.g. southeastasia
hoverTranslator.libreTranslateUrl "" e.g. http://localhost:5000/translate
hoverTranslator.mymemoryEmail "" Raises MyMemory's anonymous quota

Rate limiting and performance

Setting Default Description
hoverTranslator.hoverDelay 250 Milliseconds the pointer must rest before requesting
hoverTranslator.requestTimeout 5000 Per-request timeout
hoverTranslator.minRequestDelay 700 Minimum gap between outbound requests
hoverTranslator.maxRequestsPerMinute 20 Hard ceiling per rolling minute
hoverTranslator.maxQueueSize 5 Waiting requests before the oldest is dropped
hoverTranslator.cacheTtlDays 30 How long a cached translation stays valid
hoverTranslator.cacheLimit 5000 Cached entries before LRU eviction
hoverTranslator.negativeCacheMinutes 10 How long a failure suppresses retries
hoverTranslator.maxSelectionLength 2000 Longest selection translated on hover

Example: fully local setup

{
  "hoverTranslator.provider": "libretranslate",
  "hoverTranslator.libreTranslateUrl": "http://localhost:5000/translate",
  "hoverTranslator.targetLanguage": "Vietnamese",
  // A local server has no quota, so the throttle can be relaxed.
  "hoverTranslator.maxRequestsPerMinute": 120,
  "hoverTranslator.minRequestDelay": 0
}
docker run -p 5000:5000 libretranslate/libretranslate --load-only en,vi

Caching

Translations are cached on disk in the extension's global storage and survive restarts. Entries expire cacheTtlDays days after they were fetched (reading one does not extend its life), and the least recently used entries are evicted once cacheLimit is reached. The file is written atomically, so an interrupted write cannot corrupt it.

Troubleshooting

Symptom What to check
Nothing appears on hover Is the status bar showing $(check) Translate? Was the privacy notice accepted? Is the file excluded?
⚠ Translate (Nm) in the status bar Every provider is cooling down. Hover the item for the reason, or add an API key.
Hover feels slow Lower hoverDelay, or add an API key so requests are not queued behind the free endpoints' throttle.
Translation quality is poor for identifiers Disable useOfflineDictionary to use the provider instead, or switch to DeepL.
Anything unexpected Hover Translator: Show Logs — every decision, skip reason and provider error is logged.

Development

npm install
npm run watch        # esbuild in watch mode
npm run lint
npm run check-types
npm test             # node:test unit tests, no network required
npm run bundle:prod
npm run package      # requires Node >= 20 (see DEPLOY.md)

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft