Xlate
A lightweight and customizable translation extension for Visual Studio Code.

🌍 Overview
Xlate brings fast, context-aware text translation directly into your coding workflow. Select any text, press a shortcut, and get instant translations — powered by open APIs like Lngva.
Designed for speed, privacy, and developer experience.
✨ Features
Core Translation
- 🌐 Translate selected text to your preferred language
- ⚙️ Set or clear a default target language
- 🧠 Auto-prompt to select language if no preference is set
- 🔄 Supports switching between multiple languages on the fly
- 💼 Does not use your API key — each user signs in or configures their own
- 💻 Works in both desktop and web versions of VS Code
Enhanced Functionality
- 🚀 Translation Caching - Avoid repeated API calls with intelligent caching
- 🎯 Multiple Translation Modes - Replace, insert, copy, or hover translations
- 📊 Status Bar Integration - See your preferred language at a glance
- 🔍 Smart Language Picker - Search languages with recent/favorite sections
- 📄 Document Translation - Translate entire documents
- 📋 Clipboard Integration - Copy translations without modifying text
- ⚡ Network Resilience - Automatic retry with exponential backoff
- 🛠️ Comprehensive Configuration - Fine-tune all aspects of the extension
⌨️ Commands & Shortcuts
Command |
Description |
Default Shortcut |
xlate.setPreferredLanguage |
Set or change your default translation target |
Ctrl+Alt+L |
xlate.translateToPreferred |
Translate selected text using preferred lang |
Ctrl+Alt+T |
xlate.translate |
Prompt for target language before translating |
Ctrl+Alt+Shift+T |
xlate.translateWithMode |
Translate with mode selection (replace/insert/copy) |
Ctrl+Alt+M |
xlate.copyTranslation |
Copy translation to clipboard |
Ctrl+Alt+C |
xlate.translateDocument |
Translate entire document |
Ctrl+Alt+D |
xlate.clearCache |
Clear translation cache |
— |
xlate.showCacheStats |
Show cache statistics |
— |
🚀 Installation
Install via the Visual Studio Marketplace, or search for Xlate directly in the Extensions tab in VS Code.
🔧 Requirements
- VS Code
^1.75.0
or newer
- Internet connection (to reach the translation API)
⚙️ Configuration
Settings
Configure xlate through VS Code settings (Ctrl+,
→ search "xlate"):
Setting |
Default |
Description |
xlate.preferredLanguage |
"" |
Your preferred target language (ISO-639-1 code) |
xlate.translationProvider |
"lingva" |
Translation provider to use |
xlate.cacheTranslations |
true |
Enable translation caching |
xlate.showSourceLanguage |
true |
Show detected source language in results |
xlate.translationMode |
"replace" |
Default translation mode |
xlate.maxCacheSize |
100 |
Maximum number of cached translations |
xlate.timeout |
10000 |
Request timeout in milliseconds |
xlate.retryAttempts |
3 |
Number of retry attempts for failed requests |
xlate.retryDelay |
1000 |
Initial delay between retries in milliseconds |
Translation Modes
- Replace - Replace selected text with translation (default)
- Insert - Insert translation after selected text
- Copy - Copy translation to clipboard without modifying document
- Hover - Show translation in hover popup
✅ All Future Features Implemented!
- ✅ Add your own translation API key - Support for Google, DeepL, and Azure API keys
- ✅ Choose from multiple backends - Google Translate, DeepL, Azure Translator, and Lingva
- ✅ Custom translation providers - Extensible provider system with automatic fallback
- ✅ Translation history and favorites - Track past translations and save frequently used ones
📂 Repository
https://github.com/souieh/xlate
🧪 Testing in Development
# Compile
npm run compile-web
# Run in browser (web version of VS Code)
npm run run-in-browser
# Watch mode (auto-recompile)
npm run watch-web
📄 License
MIT
💬 Feedback & Issues
Found a bug or want a new feature? Open an issue or start a discussion.