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

VSCode Content Translator

Boyka Chongyang Zhu

|
2 installs
| (0) | Free
Translate selected text using Copilot model with hover display, including phonetics and example sentences
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Content Translator

一个 VS Code 扩展,支持使用 GitHub Copilot 或 Google Gemini 模型翻译编辑器中选中的文本,结果以悬停窗口形式展示,包含音标和例句。

功能

  • 🔤 选中文本,一键翻译,结果以悬停窗口显示
  • 📖 自动提供音标(英文 IPA / 中文拼音 / 日文假名等)
  • 📝 给出 2-3 条实用例句及译文
  • 🤖 支持多种 Copilot 模型,可动态切换
  • 🌐 支持 Google AI(Gemini)作为翻译后端,无需 Copilot 订阅
  • ⚙️ 可自定义目标语言
  • 🖱️ 右键菜单快速触发翻译

使用方法

  1. 在编辑器中选中要翻译的文本
  2. 使用快捷键 Ctrl+Shift+T(Mac: Cmd+Shift+T)
  3. 或右键选择 Translate Selection
  4. 或通过命令面板运行 VSCode Content Translator: Translate Selection
  5. 翻译结果会以悬停窗口的形式显示,持续 30 秒

命令

命令 说明
VSCode Content Translator: Translate Selection 翻译当前选中文本
VSCode Content Translator: Select Translation Model 从可用的 Copilot 模型中动态选择翻译模型

设置

设置项 说明 默认值
vscodeContentTranslator.model 翻译使用的模型。auto 跟随 Copilot 默认模型,google 使用 Google Gemini,或填入具体模型名(如 gpt-4.1-mini) gpt-5.4-mini
vscodeContentTranslator.targetLanguage 翻译的目标语言 Chinese (Simplified)
vscodeContentTranslator.googleApiKey Google AI Studio API Key(免费),将 model 设为 google 时生效 ``
vscodeContentTranslator.googleModel 使用 Google 后端时的模型名 gemini-2.5-flash

支持的目标语言:

  • Chinese (Simplified) / Chinese (Traditional)
  • English / Japanese / Korean
  • French / German / Spanish / Portuguese
  • Russian / Arabic / Italian / Dutch / Thai / Vietnamese

使用 Google Gemini(免费)

  1. 前往 Google AI Studio 获取免费 API Key
  2. 在 VS Code 设置中填写 vscodeContentTranslator.googleApiKey
  3. 将 vscodeContentTranslator.model 设为 google

前置要求

  • VS Code 1.95.0 或更高版本
  • 使用 Copilot 模型:需安装并登录 GitHub Copilot 扩展
  • 使用 Google 模型:仅需 Google AI Studio API Key

开发

npm install
npm run compile
# 按 F5 启动调试
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft