private createTranslationPrompt( comment: string, context?: TranslationContext): string { const basePrompt = `Translate the following Chinese code comment to English:Chinese comment: "${comment}"Requirements:1. Keep the same tone and style2. Preserve any code-related terminology3. Maintain brevity and clarity4. Return only the translated text without quotes`; if (context) { return basePrompt + `Context:- File type: ${context.language}- Function/Variable name: ${context.nearbyCode}- Comment type: ${context.commentType}`; } return basePrompt;}
中文备注转换为英文 - 技术规格说明
1. 文件扫描模块详细设计
1.1 Git文件获取
1.2 文件扩展名过滤
1.3 编程语言识别
2. 中文检测模块详细设计
2.1 注释解析器
2.2 中文字符检测
2.3 注释位置定位
3. 翻译服务模块详细设计
3.1 OpenAI API集成
3.2 翻译提示词优化
3.3 批量翻译优化
4. 文件替换模块详细设计
4.1 精确位置替换
4.2 备份机制
4.3 格式保持
5. 报告生成模块详细设计
5.1 统计数据收集
5.2 报告格式化
6. 函数式编程工具
6.1 基础FP工具
6.2 异步处理工具
6.3 错误处理
7. 配置管理
7.1 配置文件结构
7.2 配置加载
8. 性能优化策略
8.1 并发控制
8.2 缓存机制