VSCode Translation
January 7, 2026 · View on GitHub
Translation plugin supporting Tencent Cloud, Baidu, and Youdao translation APIs. This extension helps developers translate text directly within VS Code.
Now supports VS Code 1.107.0 and later, macOS, Linux, and Windows.
Features
- Context menu translation: Right-click on selected text and choose "tlcsdm" → "Translate" to translate.
- Keyboard shortcut: Press
Ctrl+Alt+T(Windows/Linux) orCmd+Alt+T(macOS) with selected text to translate. - Translation View: Dedicated panel for translation with source and target language selection.
- Status bar engine switch: Click the translation engine indicator in the status bar to switch between providers.
- Multiple providers: Support for Tencent Cloud, Baidu, and Youdao translation services.
- Configurable settings: Customize default engine, source/target languages, and API credentials.
Usage
Manual Translation (Context Menu)
- Select the text you want to translate
- Right-click to open context menu
- Select "tlcsdm" → "Translate"
Keyboard Shortcut
- Select the text you want to translate
- Press
Ctrl+Alt+T(Windows/Linux) orCmd+Alt+T(macOS)
Translation View
- Click the Translation icon in the Activity Bar
- Enter text in the source text area
- Select source and target languages
- Click "Translate" or enable auto-translation
Switch Translation Engine
- Click on the engine name in the status bar (bottom right)
- Or use Command Palette: "Translation: Switch Engine"
Configuration
Open VS Code Settings and search for "Translation" to configure:
| Setting | Type | Default | Description |
|---|---|---|---|
tlcsdm.translation.defaultEngine | string | tencent | Default translation engine |
tlcsdm.translation.sourceLanguage | string | auto | Source language for translation |
tlcsdm.translation.targetLanguage | string | zh | Target language for translation |
tlcsdm.translation.tencent.secretId | string | Tencent Cloud SecretId | |
tlcsdm.translation.tencent.secretKey | string | Tencent Cloud SecretKey | |
tlcsdm.translation.baidu.appId | string | Baidu Translation API App ID | |
tlcsdm.translation.baidu.secretKey | string | Baidu Translation API Secret Key | |
tlcsdm.translation.youdao.appKey | string | Youdao Translation API App Key | |
tlcsdm.translation.youdao.appSecret | string | Youdao Translation API App Secret |
Supported Languages
| Code | Language |
|---|---|
| auto | Auto detect |
| zh | Chinese |
| en | English |
| ja | Japanese |
API Configuration
Tencent Cloud Translation
- Visit Tencent Cloud Console
- Create a new CAM user or use existing credentials
- Copy SecretId and SecretKey to extension settings
Baidu Translation
- Visit Baidu Translation Open Platform
- Create an application
- Copy App ID and Secret Key to extension settings
Youdao Translation
- Visit Youdao AI Open Platform
- Create an application
- Copy App Key and App Secret to extension settings
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "Translation"
- Click Install
From VSIX File
- Download the
.vsixfile from Releases - In VS Code, open Command Palette (
Ctrl+Shift+P) - Search for "Extensions: Install from VSIX..."
- Select the downloaded
.vsixfile
From Jenkins
Download from Jenkins
Build
This project uses TypeScript and npm (Node.js 22).
# Install dependencies
npm install
# Compile
npm run compile
# Watch mode (for development)
npm run watch
# Lint
npm run lint
# Package
npx @vscode/vsce package
# Test
npm run test
Related Projects
- eclipse-translation - Eclipse version of this plugin
License
MIT License - see LICENSE for details.