A VSCode code comment translation plugin that supports large model invocation, serving as a translation source extension for Comment Translate
- 🤖 Adopts OpenAI API standards
- 🎯 Intelligent naming of parameters such as functions, classes, and variables, optimizing names according to naming conventions
- ⚡ Fast translation response
- 🛠️ Flexible configuration options
- Install Comment Translate
- Install this extensionComment Translate for AI
- Open the command palette in VS Code (Ctrl+Shift+P)
- Type "Comment Translate: Change translation source"
- Select "AI Translate" as the translation source
Configure the following options in VS Code settings:
Option | Description | Default |
---|---|---|
aiTranslate.largeModelApi |
Large model API endpoint | - |
aiTranslate.largeModelKey |
API key | - |
aiTranslate.largeModelName |
Model name | - |
aiTranslate.largeModelMaxTokens |
Maximum tokens (0 means unlimited) | 2048 |
aiTranslate.largeModelTemperature |
The temperature parameter of a large model (a lower value produces more certain results, while a higher value yields more diverse outcomes) |
0.2 |
aiTranslate.namingRules |
Naming Conventions | Translation: Determined by AI itself |
- Please configure the API-related information and ensure that the large model service provider you are using is compatible with OpenAI's API call format OpenAI Official Documentation
- Once configuration is complete, please execute the "Comment Translate" command from the "Comment Translate:Change translate source" section
- Select "AI translate" as the translation source
- Right-click the mouse→Select "Comment Translation" from the list→Click "AI Naming" to use it
- Translate the naming according to the selected naming format into English
- Optimize naming according to the naming convention
Issues and Pull Requests are welcome!
- 🎉 Initialize project
- ✨ Implement basic translation
- 🔧 Add configuration options
- 🔧 Modify setting name
- 🔧 Add Model Temperature setting
- 🤖 Add an AI naming feature that allows the AI to intelligently assign names to parameters such as variables, functions, and classes based on your settings or its own judgment
- 🌐 Added configuration files for multilingual environments
- 🔍 "Debug feature" has been added in the plugin settings
- 🤖 Optimized AI prompts
This project is developed based on the following excellent open-source projects:
- vscode-comment-translate - VSCode comment translation extension
- deepl-translate - DeepL translation extension, the source of our base code
Special thanks to:
- @intellism for providing the excellent plugin framework and reference implementation
This project is licensed under the MIT License.
Some code is modified from deepl-translate, following its MIT license.