Comment Translate
ExtensionFreeThis extension helps developers translate comments, strings, code hints, error messages, and variable names in their code.
Capabilities9 decomposed
hover-based comment and string translation
Medium confidenceTranslates code comments, string literals, and documentation hints on-demand by intercepting VS Code's hover provider API. When a developer hovers over code elements, the extension tokenizes the text using TextMate grammar rules to identify comments and strings, sends them to a configurable translation service (Google Translate, Bing, DeepL, AliCloud), and displays the translated text in a hover tooltip without modifying the source file. This preserves the original code while providing immediate comprehension without context switching.
Uses TextMate grammar tokenization to identify code elements (comments vs strings vs code) before translation, enabling language-aware translation that respects code structure rather than translating arbitrary text. Integrates with VS Code's native hover provider system for seamless UI integration without custom UI components.
Faster than manual translation tools because it operates in-context within the editor; more accurate than regex-based comment detection because it uses proper AST-level tokenization via TextMate grammars.
immersive in-document translation overlay
Medium confidenceToggles an overlay mode (via Ctrl+Shift+Z) that displays translations directly in the editor document alongside or replacing original comment and string text. The extension renders translated text as inline decorations using VS Code's decoration API, allowing developers to read translated content without hovering. A secondary toggle (Ctrl+Shift+B) switches between 'alongside' mode (original + translation side-by-side) and 'replace' mode (translation replaces original), with the display mode persisting across the current session.
Leverages VS Code's decoration API to render translations as non-editable inline text overlays, preserving source file integrity while providing immersive reading experience. Dual-mode toggle (alongside vs replace) allows developers to switch between comparative and focused reading without reloading.
More immersive than hover-only translation because it keeps translations visible during continuous code review; less intrusive than full-file replacement because 'alongside' mode preserves original context for reference.
command-palette-triggered text replacement translation
Medium confidenceProvides a command palette command (accessible via Ctrl+Shift+?) that translates selected text in the editor and replaces it with the translated version in-place. The extension captures the user's text selection, sends it to the configured translation service, and writes the translated result back to the editor at the same location, modifying the source file. This enables one-off translations of specific code sections without toggling immersive mode.
Integrates with VS Code's command palette and editor selection API to provide a stateless, one-off translation workflow that modifies source files directly. No intermediate UI or preview step; translation result is immediately committed to the file.
More direct than hover translation for developers who want to permanently change code; faster than copy-paste-to-external-tool workflows because it operates in-context.
variable naming suggestion with translation
Medium confidenceProvides a 'Translate Variable Naming' command that translates a selected variable name or description into multiple naming suggestions in the target language. The extension sends the original name/description to the translation service and generates alternative naming options (e.g., camelCase, snake_case, PascalCase variants) based on the translated result. Developers can then manually select and replace the original variable name with one of the suggestions.
Combines translation with naming convention generation, producing multiple case-variant suggestions from a single translated term. Integrates with VS Code's command palette to surface naming suggestions without requiring external tools.
More context-aware than generic naming tools because it translates the original variable description first; faster than manual renaming because it generates multiple options at once.
github copilot chat integration with @translate participant
Medium confidenceExtends GitHub Copilot Chat with a `@translate` chat participant that allows developers to send selected code text to Copilot Chat for translation. The extension registers a custom chat participant that intercepts `@translate` mentions in Copilot Chat, passes the selected text to Copilot's AI model (not the configured translation service), and returns the translated result within the chat interface. This leverages Copilot's language understanding for context-aware translation rather than generic translation APIs.
Registers a custom chat participant with Copilot Chat API, allowing `@translate` mentions to trigger Copilot's language model for translation instead of external translation services. Keeps translation workflow within the chat interface for unified AI assistance.
More context-aware than generic translation APIs because Copilot can understand code semantics; integrates with existing Copilot Chat workflow for developers already using Copilot as primary assistant.
configurable multi-service translation backend
Medium confidenceAbstracts translation service selection through a configuration system that allows developers to choose between multiple translation providers (Google Translate, Bing Translator, AliCloud Translation, DeepL) and optionally configure custom translation services. The extension routes all translation requests through a service adapter pattern that normalizes API calls to different providers, allowing developers to switch services without changing their workflow. Configuration is managed through VS Code settings (specific setting names not documented).
Implements a service adapter pattern that normalizes API calls across heterogeneous translation providers (Google, Bing, DeepL, AliCloud, custom), allowing developers to swap services without workflow changes. Supports custom service integration for enterprise or regional requirements.
More flexible than single-service tools because it supports multiple providers and custom backends; enables cost optimization by allowing service switching based on quota or pricing.
markdown document translation with preview
Medium confidenceTranslates Markdown content in VS Code's Markdown preview pane, displaying translated text alongside or replacing the original Markdown source. The extension hooks into VS Code's Markdown preview rendering pipeline to intercept and translate Markdown text before display. Developers can toggle translation on/off in the preview pane without modifying the source Markdown file.
Integrates with VS Code's Markdown preview rendering pipeline to translate content at render-time rather than modifying source files. Preserves Markdown structure while translating text content.
More convenient than copying Markdown to external translation tools because it operates within VS Code's preview interface; preserves source file integrity by not modifying the original.
customizable keybinding shortcuts for translation actions
Medium confidenceAllows developers to customize keyboard shortcuts for all translation actions (hover translation, immersive mode toggle, text replacement, variable naming) through VS Code's keybindings configuration. Default keybindings are provided (Ctrl+Shift+?, Ctrl+Shift+Z, Ctrl+Shift+B), but developers can override them in their keybindings.json file to match their preferred workflow. The extension respects VS Code's keybinding precedence and conflict resolution.
Leverages VS Code's native keybindings system to allow full customization of translation shortcuts without requiring extension-specific configuration UI. Respects VS Code's keybinding precedence and conflict resolution.
More flexible than fixed keybindings because developers can adapt shortcuts to their workflow; integrates seamlessly with VS Code's keybinding ecosystem.
error message and code hint translation on hover
Medium confidenceTranslates error messages, exception text, and code hints (documentation tooltips) that appear in VS Code's hover provider system. The extension intercepts hover events for code elements that trigger error messages or documentation hints, translates the hover text using the configured translation service, and displays the translated version in the hover tooltip. This enables developers to understand compiler errors, runtime exceptions, and API documentation in their native language without leaving the editor.
Specifically targets error and hint text from VS Code's hover provider system, translating technical messages that developers encounter during development. Integrates with language servers and debuggers through VS Code's hover API.
More immediate than searching for error messages online because translations appear in-context; more accurate than manual translation because it preserves technical terminology.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with Comment Translate, ranked by overlap. Discovered automatically through the match graph.
TranslationToolbox
划词翻译:有道短词 + 豆包长句;启动即激活
Immersive Translate
Bilingual side-by-side webpage translation extension.
Readable - AI Generated Comments
🚀 Instantly generate detailed comments for your code using AI. Supports Javascript, TypeScript, Python, JSX/TSX, C, C#, C++, Java, and PHP
Pismo
AI-powered tool enhances writing with suggestions, translations,...
Docify AI - Docstring & comment writer
Your AI-powered code companion. Our first set of features includes docstring & comment writer and code-aware comment translation.
UseChatGPT.AI
AI writing assistant on every website without copy-pasting.
Best For
- ✓multilingual development teams working with codebases in non-native languages
- ✓solo developers learning from open-source projects written in foreign languages
- ✓teams maintaining legacy code with inconsistent comment languages
- ✓developers doing deep code reviews of multilingual codebases
- ✓teams onboarding new members who don't speak the original comment language
- ✓developers learning from foreign-language open-source projects over extended sessions
- ✓developers performing targeted code cleanup or refactoring in multilingual codebases
- ✓teams standardizing comment language across a project
Known Limitations
- ⚠Hover translation adds network latency per API call to translation service (typically 200-500ms depending on service)
- ⚠Only translates content exposed through VS Code's hover provider API; cannot access inline comments without explicit hover
- ⚠No caching mechanism documented, so repeated hovers over same text trigger duplicate API calls
- ⚠Limited to single-file context; cannot resolve cross-file references or project-wide documentation
- ⚠Immersive mode requires continuous API calls to translation service for every comment/string in the file, creating significant network overhead and potential rate-limiting issues
- ⚠Display mode toggle (alongside vs replace) is session-only; preference does not persist across VS Code restarts
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
This extension helps developers translate comments, strings, code hints, error messages, and variable names in their code.
Categories
Alternatives to Comment Translate
Are you the builder of Comment Translate?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →