VS Code & Cursor extension that translates comments, logs, print statements, and error messages in your codebase to any language.
- Multi-language translation powered by DeepL API (500k free characters/month)
- Selective translation — choose exactly what to translate:
- Comments (single-line and multi-line)
- Log statements (
console.log,logger.info, etc.) - Print statements (
print,println,echo, etc.) - Error messages (
throw new Error,raise Exception, etc.) - Plain text files (
.txt,.md) - String literals (optional)
- Preview mode — see a diff before applying any changes
- Batch processing — translate entire project or just selected files
- Smart detection — only non-English text is sent for translation
- Works with all programming languages
(coming soon)
- Download the latest
.vsixfrom Releases - In VS Code:
Extensions→...→Install from VSIX
git clone https://github.com/i-ymka/comment-translator.git
cd comment-translator
npm install
npm run compilePress F5 in VS Code to launch Extension Development Host.
- Get a free DeepL API key at deepl.com/pro-api (500k chars/month free)
- Open the Comment Translator panel in the sidebar
- Paste your API key and select target language
Via sidebar panel:
- Click the Comment Translator icon in the Activity Bar
- Configure: API key, target language, what to translate, preview vs replace mode
- Click Translate
Via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Comment Translator: Translate Current FileComment Translator: Translate Whole ProjectComment Translator: Translate Selected Files
Before (Russian comments):
# Вычисление суммы двух чисел
def calculate_sum(a, b):
print("Складываем числа")
return a + bAfter (translated to English):
# Calculating the sum of two numbers
def calculate_sum(a, b):
print("Adding numbers")
return a + bEnglish · German · French · Spanish · Italian · Portuguese · Russian · Japanese · Chinese · Korean · and more via DeepL
| Setting | Description | Default |
|---|---|---|
commentTranslator.deeplApiKey |
DeepL API key | "" |
commentTranslator.targetLanguage |
Target language | EN-US |
commentTranslator.translateComments |
Translate comments | true |
commentTranslator.translateLogs |
Translate log statements | true |
commentTranslator.translatePrints |
Translate print statements | true |
commentTranslator.translateErrors |
Translate error messages | true |
commentTranslator.translateStrings |
Translate string literals | false |
commentTranslator.mode |
preview or replace |
preview |
commentTranslator.scope |
currentFile or wholeProject |
currentFile |
MIT — free to use, modify, and distribute.
Powered by DeepL API
