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) or Cmd+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)

  1. Select the text you want to translate
  2. Right-click to open context menu
  3. Select "tlcsdm" → "Translate"

Keyboard Shortcut

  1. Select the text you want to translate
  2. Press Ctrl+Alt+T (Windows/Linux) or Cmd+Alt+T (macOS)

Translation View

  1. Click the Translation icon in the Activity Bar
  2. Enter text in the source text area
  3. Select source and target languages
  4. 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:

SettingTypeDefaultDescription
tlcsdm.translation.defaultEnginestringtencentDefault translation engine
tlcsdm.translation.sourceLanguagestringautoSource language for translation
tlcsdm.translation.targetLanguagestringzhTarget language for translation
tlcsdm.translation.tencent.secretIdstringTencent Cloud SecretId
tlcsdm.translation.tencent.secretKeystringTencent Cloud SecretKey
tlcsdm.translation.baidu.appIdstringBaidu Translation API App ID
tlcsdm.translation.baidu.secretKeystringBaidu Translation API Secret Key
tlcsdm.translation.youdao.appKeystringYoudao Translation API App Key
tlcsdm.translation.youdao.appSecretstringYoudao Translation API App Secret

Supported Languages

CodeLanguage
autoAuto detect
zhChinese
enEnglish
jaJapanese

API Configuration

Tencent Cloud Translation

  1. Visit Tencent Cloud Console
  2. Create a new CAM user or use existing credentials
  3. Copy SecretId and SecretKey to extension settings

Baidu Translation

  1. Visit Baidu Translation Open Platform
  2. Create an application
  3. Copy App ID and Secret Key to extension settings

Youdao Translation

  1. Visit Youdao AI Open Platform
  2. Create an application
  3. Copy App Key and App Secret to extension settings

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Translation"
  4. Click Install

From VSIX File

  1. Download the .vsix file from Releases
  2. In VS Code, open Command Palette (Ctrl+Shift+P)
  3. Search for "Extensions: Install from VSIX..."
  4. Select the downloaded .vsix file

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

License

MIT License - see LICENSE for details.