Skip to content

Latest commit

 

History

History
102 lines (65 loc) · 5.13 KB

README_en.md

File metadata and controls

102 lines (65 loc) · 5.13 KB

Comment Translate AI

A VSCode code comment translation plugin that supports large model invocation, serving as a translation source extension for Comment Translate

⚠️This plugin does not provide a large model API. Please prepare your own API and ensure it supports the calling format of OpenAI's API

简体中文|English

✨ Features

  • 🤖 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

📦 Installation

  1. Install Comment Translate
  2. Install this extensionComment Translate for AI
  3. Open the command palette in VS Code (Ctrl+Shift+P)
  4. Type "Comment Translate: Change translation source"
  5. Select "AI Translate" as the translation source

⚙️ Configuration

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

🚀 Quick Start

  1. 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 配置
  2. Once configuration is complete, please execute the "Comment Translate" command from the "Comment Translate:Change translate source" section 换源
  3. Select "AI translate" as the translation source 选择

How to use "AI Naming"

  • 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 AI命名

🤝 Contributing

Issues and Pull Requests are welcome!

📝 Changelog

0.0.1

  • 🎉 Initialize project
  • ✨ Implement basic translation
  • 🔧 Add configuration options

0.0.2

  • 🔧 Modify setting name

0.0.3

  • 🔧 Add Model Temperature setting

0.0.4

  • 🤖 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

0.0.5

  • 🔍 "Debug feature" has been added in the plugin settings

0.0.6

  • 🤖 Optimized AI prompts

🙏 Acknowledgments

This project is developed based on the following excellent open-source projects:

Special thanks to:

  • @intellism for providing the excellent plugin framework and reference implementation

📄 License

This project is licensed under the MIT License.

Some code is modified from deepl-translate, following its MIT license.