yxw007/vscode-translate-next
About
🎉一款简单易用支持多种翻译引擎的vscode插件,A translate vscode extension that supports multiple translation engines
AI & Machine LearningMeasured star growth
- in 24h
- Collecting history
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_en.md
Originalvscode-translate-next
A powerful VSCode translation extension that breaks language barriers and lets you focus on immersive coding 🚀
Powered by translate
✨ Features
- Hover Translation — Translate on hover

- Hover Comment Replace — Hover and replace comments inline

- Replace All Comments — Batch translate all comments in your project

- Replace Selected Paragraph Comments — Select a block of code and batch translate the comments inside it

- Translate Terminal Text — Select text in the terminal and translate instantly

- Extension Details Immersive Translation — Read foreign-language extensions with ease

- Markdown Preview Immersive Translation — Translate documents while previewing

- Selected Text Translation — Select any text and translate on the fly

- Smart Identifier from Selection — Turn Chinese or other non-English text into naming-convention-aware identifiers

- Custom Translation Engine — Bring your own translation service

📋 Requirements
- vscode >= 1.146.0
⚙️ Configure Translation Engine

Google and Bing work out of the box. For other engines, configure your API keys in settings.
📝 Tutorials
- Configure Baidu Translation
- Configure Tencent Translation
- Configure Azure Machine Translation
- Configure DeepL Machine Translation
- Configure Custom Translation Engine (DeepSeek, Zhipu, Qwen, Xiaomi MiMo)
Keys shown in tutorials are for demonstration only — all have expired.
🎬 Video Tutorials
- A Must-Have VS Code Extension for Immersive Coding
- Quick Start Guide for VS Code Translation Extension
🧠 Smart Identifier from Selected Text
- Select some Chinese (or other non-English) text in your code, e.g.
获取用户信息 - Press
Ctrl + Alt + Shift + T(Cmd + Alt + Shift + Ton macOS), or right-click → Translate-next → Translate Selection to Identifier Name - The selection is highlighted in red while processing; the first candidate (e.g.
getUserInformation) is written to the selection and the suggestion list pops up - Press Enter to keep the top candidate, press
↓to pickGetUserInformation/get_user_informationetc., orCtrl + Zto revert
- Detects the semantic role (variable, constant, class, interface, function, type alias, CSS class) and reorders candidates accordingly
- If the selection is already English (e.g.
getUserInfo), no translation request is made — it is converted to the other styles directly - Configure preferred styles per language with
Translate-next.namingConventions, e.g.:{ "python": { "variable": "snake_case", "function": "snake_case" } }
🖱️ Hover Scope (Customizable)
Controlled by Translate-next.hover.extensions:
- Default: Built-in allowlist of mainstream programming languages —
js,jsx,ts,tsx,java,py,c,h,cpp,cc,cxx,hpp,hh,hxx,rs,go,cs,php,rb,swift,kt,kts,scala,dart,lua - Usage: Comma-separated, with or without dots, e.g.
ts,js,pyor.ts,.js,.py - Special: Set to
*to enable hover on all files (not recommended, may cause unnecessary token usage) - Note: If your extension isn't in the default list, just append it
💻 Supported Translation Engines
| Engine | Pricing | Rating | Description |
|---|---|---|---|
| Free | ⭐⭐⭐⭐ | Great results, requires access to Google | |
| Bing | Free | ⭐⭐⭐⭐ | No network restrictions, ready to use, a bit slow |
| Azure Translate | 2M chars/month free | ⭐⭐⭐⭐⭐ | Great results, fast |
| Amazon Translate | 2M chars/month free | ⭐⭐⭐⭐⭐ | Great results, fast |
| Baidu | 1M chars/month free | ⭐⭐⭐⭐⭐ | Great results, fast |
| DeepL | 1M chars/month free | ⭐⭐⭐⭐⭐ | Great results, fast |
| Tencent | 5M chars/month free | ⭐⭐⭐⭐ | No longer recommended, service ends 2026/07/31 |
| Custom Engine | Fully customizable | ⭐⭐⭐ | Depends on your API, recommended: DeepSeek-v4-flash |
🛠️ Quick Start
- Install — Get it from VS Code Marketplace
- Register — Create an account at translate.yanxuewen.cn
- Sign in

⌨️ Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Replace selected text with translation | Shift + Alt + T |
Shift + Alt + T |
| Switch target language | Ctrl + Alt + Shift + L |
Cmd + Alt + Shift + L |
| Switch default translation engine | Alt + Shift + E |
Alt + Shift + E |
| View extension logs | Ctrl + Alt + Shift + O |
Cmd + Alt + Shift + O |
| Clear extension logs | Ctrl + Alt + C |
Cmd + Alt + C |
| Translate terminal selected text | Ctrl + Alt + `` |
Cmd + Alt + `` |
| Clear terminal translation logs | Alt + C |
Alt + C |
| Open terminal translation panel | Alt + Shift + O |
Alt + Shift + O |
| Enable/disable hover translation | Ctrl + Alt + E |
Ctrl + Alt + E |
| Replace all comments | Ctrl + Alt + Shift + C |
Cmd + Alt + Shift + C |
| Replace comments in selected paragraph | Alt + Shift + C |
Alt + Shift + C |
| Selection to identifier name | Ctrl + Alt + Shift + T |
Cmd + Alt + Shift + T |
Shortcuts conflict? Adjust them in VS Code. You can also use the status bar buttons to switch language and engine:

❓ FAQ
1. fetch failed Error

Answer: If you haven't changed the default engine, Google is used. When your network can't reach Google, this error appears. Switch to another engine.
2. How Do I Get Keys for Other Engines?
Answer: Check the translate docs for each engine's configuration guide.
3. Shortcuts Not Working?
- Cause 1: Conflicts with other VS Code shortcuts → modify the conflicting shortcut
- Cause 2: Conflicts with external software → exit apps one by one to identify the conflict
- Hidden tricks:
- Right-click in the editor to replace selected text with translation

- Enable terminal translation button in the bottom bar via settings

- Right-click in the editor to replace selected text with translation
4. How to Avoid Excessive Character Usage?
- Increase cache duration to reduce repeated translations

- Enable only the features you need

- Avoid hovering over large selections — selecting a large block and triggering hover translation consumes characters quickly
5. Why doesn't the "Log In" button in the bottom bar respond when I click it?
- Possible cause: When you clicked "Log In" for the first time, you accidentally clicked "Do Not Authorize" or "Reject" in the authorization prompt that appeared.
- Solution:
- Press
F1in the editor ->Manage Trusted Domains - Add the plugin’s official website address to the
Trusted Domainsconfiguration file[ ... "https://translate.yanxuewen.cn", ]
- Press
💖 Support the Project
If this tool has saved you time, consider supporting continued development:
Buy me a coffee ☕ — every contribution helps drive improvements

Follow and support my videos on Bilibili: 向往自由的码
Star ⭐ the project on GitHub and share it with other developers
Thank you for your support ❤️ — it will be prioritized for new features. For suggestions or requests, open an issue or message me.
📢 Learn More
- For other engine configs, see the translate README
- Problems? Leave a message, open an Issue, or contact me on WeChat (
aa4790139)
📄 License
This project is released under the MIT License. See LICENSE for details.
Explore related projects
Loading…