|
55 | 55 | "en": "// If file doesn't exist, we start with empty mapping (initialized in NewStore)", |
56 | 56 | "zh-CN": "// 如果文件不存在,我们从空映射开始(在 NewStore 中初始化)" |
57 | 57 | }, |
| 58 | + "1100deea685325780dd3995ea189d29d9fa1a810": { |
| 59 | + "en": "// [MOCK zh-CN-\u003een] // The comment is in the local language (Chinese), stored as LocalLanguage", |
| 60 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 注释是本地语言(中文),存储为 LocalLanguage" |
| 61 | + }, |
58 | 62 | "1212027339bde3555270d9d66713c0003eaaf405": { |
59 | 63 | "en": "// Config represents the project configuration", |
60 | 64 | "zh-CN": "// Config 代表项目配置" |
|
67 | 71 | "en": "// Find source text (from source lang)", |
68 | 72 | "zh-CN": "// 查找源文本(从源语言)" |
69 | 73 | }, |
| 74 | + "18ac95d3342afd648223a8aed8bdd09bea0f5d58": { |
| 75 | + "en": "// [MOCK zh-CN-\u003een] // ContainsChinese Checks if the text contains Chinese characters", |
| 76 | + "zh-CN": "// [MOCK zh-CN-\u003een] // ContainsChinese 检查文本是否包含中文字符" |
| 77 | + }, |
70 | 78 | "18bc0f35258b2889ac9adbe4465d1e197d6234bf": { |
71 | 79 | "en": "// import, const, type, var", |
72 | 80 | "zh-CN": "// import, const, type, var" |
|
75 | 83 | "en": "// These should go to stderr", |
76 | 84 | "zh-CN": "// 这些应该输出到 stderr" |
77 | 85 | }, |
| 86 | + "1954fba125c46489ae500ace78288a04eef9c998": { |
| 87 | + "en": "// Priority: config file \u003e environment variable", |
| 88 | + "zh-CN": "// 优先级:配置文件 \u003e 环境变量" |
| 89 | + }, |
78 | 90 | "1afad503b1b83bac4c797cc9faf0f18817f84bc3": { |
79 | 91 | "en": "// read in environment variables that match", |
80 | 92 | "zh-CN": "// 读取匹配的环境变量" |
|
99 | 111 | "en": "// Currently stored in map", |
100 | 112 | "zh-CN": "// 当前存储在 map 中" |
101 | 113 | }, |
| 114 | + "1cc70f582d6b60d9702131c584b9174e7a0d5177": { |
| 115 | + "en": "// Compare normalized texts to avoid unnecessary replacements", |
| 116 | + "zh-CN": "// 比较规范化文本以避免不必要的替换" |
| 117 | + }, |
102 | 118 | "1d1109dd05b83aa1467d347b21ff0af3f9123122": { |
103 | 119 | "en": "// TranslateBatch translates a batch of texts", |
104 | 120 | "zh-CN": "// TranslateBatch 翻译一批文本" |
|
123 | 139 | "en": "// Translator defines the interface for translation services", |
124 | 140 | "zh-CN": "// Translator 定义了翻译服务的接口" |
125 | 141 | }, |
| 142 | + "2137b3eacf7bca7ba849446a033f36f1def8e439": { |
| 143 | + "en": "// Auto-detect DeepSeek URL if not set", |
| 144 | + "zh-CN": "// 如果未设置,则自动检测 DeepSeek URL" |
| 145 | + }, |
126 | 146 | "21d5787be5da6ab1088e2bb7755d503e0f305bbf": { |
127 | 147 | "en": "// Create hook content", |
128 | 148 | "zh-CN": "// 创建钩子内容" |
|
131 | 151 | "en": "// Remove block markers", |
132 | 152 | "zh-CN": "// 移除区块标记" |
133 | 153 | }, |
| 154 | + "22b95b0c1fd5dba1c42b0e7ded7fd9c95c3df3aa": { |
| 155 | + "en": "// Debug config loading", |
| 156 | + "zh-CN": "// 调试配置加载" |
| 157 | + }, |
| 158 | + "256f10689dd1551d6708e2e5468a73a636f38dd1": { |
| 159 | + "en": "// Case 2: ZH exists, EN missing -\u003e Translate ZH to EN (reverse translation)", |
| 160 | + "zh-CN": "// 情况2:存在ZH,缺少EN -\u003e 将ZH翻译为EN(反向翻译)" |
| 161 | + }, |
134 | 162 | "25b1fa5b96bc9e163b48f7ffbb25d24775c7fd39": { |
135 | 163 | "en": "// Skipping strict assertion for MVP", |
136 | 164 | "zh-CN": "// 为最小可行产品跳过严格断言" |
|
139 | 167 | "en": "// Apply replacements in reverse order", |
140 | 168 | "zh-CN": "// 按相反顺序应用替换" |
141 | 169 | }, |
| 170 | + "269c2d7efdaab3cff9240bb6b79ceaac70d918f6": { |
| 171 | + "en": "// [MOCK zh-CN-\u003een] // IsEnglish determines if the text is primarily in English", |
| 172 | + "zh-CN": "// [MOCK zh-CN-\u003een] // IsEnglish 判断文本是否主要是英文" |
| 173 | + }, |
| 174 | + "26b78823baa37787dff89b487c53252e2234fd95": { |
| 175 | + "en": "// Supports fully lowercase baseurl", |
| 176 | + "zh-CN": "// 支持全小写的 baseurl" |
| 177 | + }, |
142 | 178 | "2706578c0b650981533d8d2cbdcfeecb8e5893d3": { |
143 | 179 | "en": "// TextRange represents the range of text in the source code (1-based)", |
144 | 180 | "zh-CN": "// TextRange 表示源代码中的文本范围(基于1的索引)" |
|
147 | 183 | "en": "// Block comment /* */", |
148 | 184 | "zh-CN": "// 块注释 /* */" |
149 | 185 | }, |
| 186 | + "2aa5b10fd959f6d7a34647fca6b0bb705129c105": { |
| 187 | + "en": "// - If zh-CN exists but en is missing: zh-CN -\u003e en", |
| 188 | + "zh-CN": "// - 如果 zh-CN 存在而 en 缺失:zh-CN -\u003e en" |
| 189 | + }, |
150 | 190 | "2b5d30d04a8c0d6887a4374e1782d0d23b233eea": { |
151 | 191 | "en": "// Get returns the translation for a specific comment ID and language", |
152 | 192 | "zh-CN": "// 根据特定评论ID和语言返回对应的翻译内容" |
|
207 | 247 | "en": "// or better: log.Warn", |
208 | 248 | "zh-CN": "// 或者更好的做法:log.Warn" |
209 | 249 | }, |
| 250 | + "374d313154d1916836ca8871590bce2d8c7644f3": { |
| 251 | + "en": "// [MOCK zh-CN-\u003een] // IsChinese determines if the text is primarily in Chinese", |
| 252 | + "zh-CN": "// [MOCK zh-CN-\u003een] // IsChinese 判断文本是否主要是中文" |
| 253 | + }, |
210 | 254 | "395803016192d38bc32a244c7b5a92ce70c4f2cc": { |
211 | 255 | "en": "// Check if target lang exists and is not empty", |
212 | 256 | "zh-CN": "// 检查目标语言是否存在且不为空" |
|
251 | 295 | "en": "// Model overrides? We need to verify if provider supports model config", |
252 | 296 | "zh-CN": "// 模型覆盖?我们需要验证提供商是否支持模型配置" |
253 | 297 | }, |
| 298 | + "3dea53174d002c267c58c6cbea241d3e4db70a0a": { |
| 299 | + "en": "// 2. Translate missing English translations", |
| 300 | + "zh-CN": "// 2. 翻译缺失的英文翻译" |
| 301 | + }, |
254 | 302 | "3e014085442741b738242f1204f9a8f4e9dda404": { |
255 | 303 | "en": "// Stdout only", |
256 | 304 | "zh-CN": "// 仅输出到标准输出" |
|
259 | 307 | "en": "// But let's try a simple loop here. Ideally, `translate` command handles concurrency.", |
260 | 308 | "zh-CN": "// 但这里我们尝试一个简单的循环。理想情况下,`translate` 命令应处理并发。" |
261 | 309 | }, |
| 310 | + "3fb05fc32456cad97b8ea55504799ed4d8d7501a": { |
| 311 | + "en": "// Default DeepSeek base", |
| 312 | + "zh-CN": "// 默认的 DeepSeek 基础模型" |
| 313 | + }, |
262 | 314 | "414d032a864ca642e0e7d600a12922c34b14198a": { |
263 | 315 | "en": "// This test is manual verification mainly, but ensures compilation and basic function availability", |
264 | 316 | "zh-CN": "// 本测试主要进行人工验证,但确保编译和基本功能可用性" |
|
267 | 319 | "en": "// 3. Translate (Mock)", |
268 | 320 | "zh-CN": "// 3. 翻译(模拟)" |
269 | 321 | }, |
| 322 | + "437ef043134b58a2c4f88530bc8a8ff08d2e5d19": { |
| 323 | + "en": "// Basic check to see if it looks like Chinese (or at least changed)", |
| 324 | + "zh-CN": "// 基础检查,判断是否看起来像中文(或至少已更改)" |
| 325 | + }, |
270 | 326 | "447728161213707c064a616adc9a26f319449a52": { |
271 | 327 | "en": "// Rule: SHA1(file_path + language + symbol + normalized_text)", |
272 | 328 | "zh-CN": "// 规则:SHA1(文件路径 + 语言 + 符号 + 规范化文本)" |
|
319 | 375 | "en": "// Translate translates the text from source language to target language", |
320 | 376 | "zh-CN": "// Translate 将文本从源语言翻译为目标语言" |
321 | 377 | }, |
| 378 | + "58906e3f950e015df4deb60072cc41ca33797142": { |
| 379 | + "en": "// It runs only if OPENAI_API_KEY is set.", |
| 380 | + "zh-CN": "// 仅当设置了 OPENAI_API_KEY 时才会运行。" |
| 381 | + }, |
322 | 382 | "5891c9d1ad7df76e562dd1bc339051d61cd9e42a": { |
323 | 383 | "en": "// TextRange represents the position of text in the source file", |
324 | 384 | "zh-CN": "// TextRange 表示文本在源文件中的位置" |
|
327 | 387 | "en": "// Determine strategy", |
328 | 388 | "zh-CN": "// 确定策略" |
329 | 389 | }, |
| 390 | + "5a7adb029281a1a578262900b2e3858e677bf683": { |
| 391 | + "en": "// Normalize current comment text for comparison", |
| 392 | + "zh-CN": "// 标准化当前评论文本以便比较" |
| 393 | + }, |
| 394 | + "5a8dccb8f5357ef0c5b9fe87545b698d3636e8da": { |
| 395 | + "en": "// Restore Mode: ZH -\u003e EN", |
| 396 | + "zh-CN": "// 恢复模式:ZH -\u003e EN" |
| 397 | + }, |
330 | 398 | "5b7c0f7ef9ae77a1ef3024c07c9e192ee4e44fed": { |
331 | 399 | "en": "// End column number", |
332 | 400 | "zh-CN": "// 结束列号" |
|
359 | 427 | "en": "// assert.Contains(t, string(mapFile), \"MOCK en-\u003ezh-CN\") ", |
360 | 428 | "zh-CN": "// 断言 mapFile 字符串包含 \"MOCK en-\u003ezh-CN\"" |
361 | 429 | }, |
| 430 | + "638b157a9a626c27088d8615e6fc34cb764015d8": { |
| 431 | + "en": "// [MOCK zh-CN-\u003een] // Check if it contains Chinese characters (CJK Unified Ideographs)", |
| 432 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 检查是否包含中文字符(CJK 统一汉字)" |
| 433 | + }, |
362 | 434 | "645801cb7301eddf23186b0403d22a4b65fddfe4": { |
363 | 435 | "en": "// 4. Verify Mapping Content", |
364 | 436 | "zh-CN": "// 4. 验证映射内容" |
|
375 | 447 | "en": "// Standard loggers that write to Stderr", |
376 | 448 | "zh-CN": "// 标准日志记录器,将日志写入 Stderr" |
377 | 449 | }, |
| 450 | + "694c14146be78106d0973a2c7e8d2c9a1d7051f2": { |
| 451 | + "en": "// Current text is likely in LocalLanguage (ZH)", |
| 452 | + "zh-CN": "// 当前文本很可能为本地语言(ZH)" |
| 453 | + }, |
378 | 454 | "697d783d780d116ba66b2ec81c188734c6940523": { |
379 | 455 | "en": "// Start line number", |
380 | 456 | "zh-CN": "// 起始行号" |
|
443 | 519 | "en": "// Default target", |
444 | 520 | "zh-CN": "// 默认目标" |
445 | 521 | }, |
| 522 | + "795d186212934c9e0d9e295589759d694ef3e65a": { |
| 523 | + "en": "// Case 1: EN exists, ZH missing -\u003e Translate EN to ZH", |
| 524 | + "zh-CN": "// 情况1:EN存在,ZH缺失 -\u003e 将EN翻译为ZH" |
| 525 | + }, |
446 | 526 | "79a15c5590a733d0b626a0f894d9b2b8f1893e45": { |
447 | 527 | "en": "// Type is the type of the comment", |
448 | 528 | "zh-CN": "// Type 是评论的类型" |
|
471 | 551 | "en": "// Use scope tracking to find comment symbols", |
472 | 552 | "zh-CN": "// 使用作用域追踪来查找注释符号" |
473 | 553 | }, |
| 554 | + "81400e673eca70fe74d5af7769f0536b206e846e": { |
| 555 | + "en": "// [MOCK zh-CN-\u003een] // Intelligently detect comment language", |
| 556 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 智能检测注释语言" |
| 557 | + }, |
474 | 558 | "82cb47e0f4105416f7bda59d18f9605871752c28": { |
475 | 559 | "en": "// The contracts/cli_commands.md says:", |
476 | 560 | "zh-CN": "// contracts/cli_commands.md 文件说明:" |
|
479 | 563 | "en": "// SaveConfig writes the configuration to the .codei18n/config.json file", |
480 | 564 | "zh-CN": "// SaveConfig 将配置写入 .codei18n/config.json 文件" |
481 | 565 | }, |
| 566 | + "83eba6f346a21ef23beb33f21cdbe28d54e95098": { |
| 567 | + "en": "// [MOCK zh-CN-\u003een] // ExtractChineseChars extracts all Chinese characters from the text", |
| 568 | + "zh-CN": "// [MOCK zh-CN-\u003een] // ExtractChineseChars 提取文本中的所有中文字符" |
| 569 | + }, |
| 570 | + "84251753a7e189bda84ca6089a0089b4c0c59415": { |
| 571 | + "en": "// - If en exists but zh-CN is missing: en -\u003e zh-CN", |
| 572 | + "zh-CN": "// - 如果 en 存在而 zh-CN 缺失:en -\u003e zh-CN" |
| 573 | + }, |
482 | 574 | "848b2d9f898c06190a4bf5c3701ccaf0f33c6dac": { |
483 | 575 | "en": "// Save writes the mapping data to the specified path", |
484 | 576 | "zh-CN": "// 将映射数据保存到指定路径" |
|
563 | 655 | "en": "// Second Level Key: Language Code (e.g., \"zh-CN\")", |
564 | 656 | "zh-CN": "// 第二级键:语言代码(例如:\"zh-CN\")" |
565 | 657 | }, |
| 658 | + "98cfcc99e776a35d152acfe2bb3de333b6678144": { |
| 659 | + "en": "// 1. Update mappings for staged files (adds new Chinese comments)", |
| 660 | + "zh-CN": "// 1. 更新暂存文件的映射(添加新的中文注释)" |
| 661 | + }, |
566 | 662 | "99ce360910caeb717c18acee5976098cdb1d09dc": { |
567 | 663 | "en": "// Default to package level", |
568 | 664 | "zh-CN": "// 默认使用包级别" |
|
575 | 671 | "en": "// ParseComments is required to get comments in the AST", |
576 | 672 | "zh-CN": "// ParseComments 是获取 AST 中注释所必需的" |
577 | 673 | }, |
| 674 | + "9b7cfa149530c55907f30e65d497b574649c4795": { |
| 675 | + "en": "// [MOCK zh-CN-\u003een] // Remove comment markers", |
| 676 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 移除注释标记" |
| 677 | + }, |
578 | 678 | "9e9ff4ff1867057fb3508f8f3a3c7cee3e5c5ddf": { |
579 | 679 | "en": "// Comment represents a single comment extracted from AST", |
580 | 680 | "zh-CN": "// Comment 表示从抽象语法树中提取的单个注释" |
|
735 | 835 | "en": "// Default, should be updated from config", |
736 | 836 | "zh-CN": "// 默认值,应从配置中更新" |
737 | 837 | }, |
| 838 | + "bf8111b4e64ed571f0a78c5b6bfe88891cc02ad7": { |
| 839 | + "en": "// TestDeepSeekIntegration is a manual test to verify API connectivity.", |
| 840 | + "zh-CN": "// TestDeepSeekIntegration 是一个用于验证 API 连通性的手动测试。" |
| 841 | + }, |
738 | 842 | "c01ff44543bba070b9eb83bfc4a4aa2f2c8e083f": { |
739 | 843 | "en": "// Load reads the mapping file from disk", |
740 | 844 | "zh-CN": "// 从磁盘读取映射文件" |
|
771 | 875 | "en": "// rootCmd represents the base command when called without any subcommands", |
772 | 876 | "zh-CN": "// rootCmd 表示在没有调用任何子命令时的基础命令" |
773 | 877 | }, |
| 878 | + "c60ebc2ad9a0f896a97569633cca8c467aa9c450": { |
| 879 | + "en": "// 4. Re-stage modified files", |
| 880 | + "zh-CN": "// 4. 重新暂存已修改的文件" |
| 881 | + }, |
774 | 882 | "c6d7299f6d7a69130f541c31e164f7ebfe5c14c5": { |
775 | 883 | "en": "// (Using a simple map interface for verification)", |
776 | 884 | "zh-CN": "// (使用简单的映射接口进行验证)" |
|
791 | 899 | "en": "// json.Unmarshal might fail if there is garbage", |
792 | 900 | "zh-CN": "// 如果存在无效数据,json.Unmarshal 可能会失败" |
793 | 901 | }, |
| 902 | + "c7cd9c62b64f18e8a542ae10cb6518ab2ddaa5e4": { |
| 903 | + "en": "// [MOCK zh-CN-\u003een] // DetectLanguage detects the language of the text", |
| 904 | + "zh-CN": "// [MOCK zh-CN-\u003een] // DetectLanguage 检测文本的语言" |
| 905 | + }, |
| 906 | + "ca4e65d91da4db9094cf8784da22481744f2d176": { |
| 907 | + "en": "// [MOCK zh-CN-\u003een] // Returns \"zh-CN\" if the string contains Chinese characters, otherwise returns \"en\"", |
| 908 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 返回 \"zh-CN\" 如果包含中文字符,否则返回 \"en\"" |
| 909 | + }, |
794 | 910 | "cb4d27d814fcb68b86aeb52ef42992825f2592ab": { |
795 | 911 | "en": "// Validation", |
796 | 912 | "zh-CN": "// 验证" |
|
839 | 955 | "en": "// Override flags", |
840 | 956 | "zh-CN": "// 覆盖标志" |
841 | 957 | }, |
| 958 | + "d62bfa565ca4af35ba438346d7ff295c041e3905": { |
| 959 | + "en": "// Pre-commit workflow:", |
| 960 | + "zh-CN": "// 预提交工作流:" |
| 961 | + }, |
| 962 | + "d67d69dedfcab6910f34cd169a55f1e80e620341": { |
| 963 | + "en": "// Strategy: Bidirectional Translation", |
| 964 | + "zh-CN": "// 策略:双向翻译" |
| 965 | + }, |
842 | 966 | "d688e3c0b25b4e23a8efcb2a82ba732083d33ebd": { |
843 | 967 | "en": "// Returns a map of original text to translated text", |
844 | 968 | "zh-CN": "// 返回原始文本到翻译文本的映射" |
|
895 | 1019 | "en": "// 2. Generate IDs", |
896 | 1020 | "zh-CN": "// 2. 生成ID" |
897 | 1021 | }, |
| 1022 | + "e1b4cd16009c220f35cdc4912354d462e79f9a5d": { |
| 1023 | + "en": "// Read optional config from env or default to DeepSeek", |
| 1024 | + "zh-CN": "// 从环境变量读取可选配置,或默认使用 DeepSeek" |
| 1025 | + }, |
| 1026 | + "e20ae154784ede6f08632501a366d7152f970158": { |
| 1027 | + "en": "// 3. Convert comments to English", |
| 1028 | + "zh-CN": "// 3. 将注释转换为英文" |
| 1029 | + }, |
898 | 1030 | "e33546d3145a39e131e24c30db97813b4709c316": { |
899 | 1031 | "en": "// ID generation works.", |
900 | 1032 | "zh-CN": "// ID 生成功能正常。" |
|
907 | 1039 | "en": "// This is the ONLY function that should write to Stdout when using --format=json", |
908 | 1040 | "zh-CN": "// 在使用 --format=json 时,这是唯一应写入标准输出的函数" |
909 | 1041 | }, |
| 1042 | + "e487f7759d30cfd238b777f93e9634c8bee74f9d": { |
| 1043 | + "en": "// Search in store by comparing normalized values", |
| 1044 | + "zh-CN": "// 在存储中通过比较标准化值进行搜索" |
| 1045 | + }, |
910 | 1046 | "e61467433643b0c97500b6106a2c879e9ab14ce0": { |
911 | 1047 | "en": "// Find target text", |
912 | 1048 | "zh-CN": "// 查找目标文本" |
|
939 | 1075 | "en": "// Restore Mode", |
940 | 1076 | "zh-CN": "// 恢复模式" |
941 | 1077 | }, |
| 1078 | + "eb7c3c310508ec167c31dfd8a6522683be1075c6": { |
| 1079 | + "en": "// [MOCK zh-CN-\u003een] // The comment is in the source language (English), stored as SourceLanguage", |
| 1080 | + "zh-CN": "// [MOCK zh-CN-\u003een] // 注释是源语言(英文),存储为 SourceLanguage" |
| 1081 | + }, |
942 | 1082 | "ec17c235015c6b472539508e8a76cc6b6e6ec94f": { |
943 | 1083 | "en": "// Load reads the mapping file from the specified path", |
944 | 1084 | "zh-CN": "// 从指定路径读取映射文件" |
|
1035 | 1175 | "en": "// GetMapping returns the underlying mapping object (read-only copy recommended for complex ops)", |
1036 | 1176 | "zh-CN": "// GetMapping 返回底层映射对象(建议在复杂操作中使用只读副本)" |
1037 | 1177 | }, |
| 1178 | + "fd1e99819275e88e8ce018da885b5f036a8dc5f6": { |
| 1179 | + "en": "// Case-insensitive check for baseUrl/baseURL/base_url", |
| 1180 | + "zh-CN": "// 对 baseUrl/baseURL/base_url 进行不区分大小写的检查" |
| 1181 | + }, |
1038 | 1182 | "ffe3594d913416ff3f3770ae1ae2a968a1e724ed": { |
1039 | 1183 | "en": "// Mutex for counting", |
1040 | 1184 | "zh-CN": "// 用于计数的互斥锁" |
|
0 commit comments