Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Translator CommentNew to Visual Studio Code? Get it now.
Translator Comment

Translator Comment

Igor Sloyk

|
373 installs
| (0) | Free
A tool for translating comments in the sources of programs Python, C, C++, C#, TypeScript, JavaScript
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

translator-comments README

translator-comments is a VS Code extension for translating comments in program files like ".py",".c",".cpp",".cs", ".ts", ".js", ". json"

Features

translator-comments Translates all comments in the target file at once. Note that in Python files, a string comments is considered a string variable with no identifier. The extension requires the Google translate API to work. Translation can be done between any languages supported by the Google translate API. Get a Google translation API key (https://console.cloud.google.com/) or use the one you already got. The translator can be configured to translate single-line comments only, or single-line and multi-line comments. Individual comments can also be marked as untranslatable. For this, in the body of the comment, you need to put the marker "~~~" in any place. " It is possible to include automatic determination of the need for translation. That is, if the source is listed as "en" and in the comment, most of the letters are not English, the translation will not be performed.In addition, if the source is not specified as "en" and in the comment, most of the letters are English, the translation will not be performed. This is good for reducing the amount of translation."

Extension Settings

You can change the User Settings to specify the API and the languages you need to translate.

This extension contributes the following settings:

SourceLanguage:       "The source language to be translated."

KeyApiGoogle":        "Get a Google translation API key (https://console.cloud.google.com/) or use the one you already got."

MultilineComment":    "Check if you want to translate a multi-line comment."
CharacterDefinition": "If the source is listed as \"en\" and in the comment, most of the letters are not English, the translation will not be performed.In addition, if the source is not specified as \"en\" and in the comment, most of the letters are English, the translation will not be performed. This is good for reducing the amount of translation."

MarkComment "Comments in which three \"~~~\" characters appear in a row in any place will not be translated."

Known Issues

The keybinding might not work properly on some linux machines.

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft