feat(i18n): add 8 new language translations (de, es, fr, it, ja, ko, pt, ru)#64
feat(i18n): add 8 new language translations (de, es, fr, it, ja, ko, pt, ru)#64
Conversation
…pt, ru) Add complete localization support for 8 additional languages: - German (de): 542 strings - Spanish (es): 542 strings - French (fr): 542 strings - Italian (it): 542 strings - Japanese (ja): 542 strings - Korean (ko): 542 strings - Portuguese (pt): 542 strings - Russian (ru): 542 strings All translations follow professional UI terminology standards and maintain consistency with the existing Chinese translation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 Walkthrough概览本PR扩展了应用的本地化支持,为项目.pbxproj添加了8种新语言(德语、西班牙语、法语、意大利语、日语、韩语、葡萄牙语、俄语),并为各语言创建了对应的Localizable.strings资源文件,同时对现有中文本地化进行了小幅补充。 变更
Possibly Related PRs
预估代码审查工作量🎯 1 (Trivial) | ⏱️ ~8 分钟 诗句
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
ScreenTranslate/Resources/ja.lproj/Localizable.strings (1)
801-801: 建议将剩余英文字段统一为日语,以保证界面一致性。
Line [801]、Line [814] 目前仍为英文格式,建议本地化。可选修正示例
-"about.copyright.value" = "© 2026 All rights reserved"; +"about.copyright.value" = "© 2026 無断転載を禁じます"; -"about.acknowledgements.author.format" = "by %@"; +"about.acknowledgements.author.format" = "作者:%@";Also applies to: 814-814
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings` at line 801, The two localized string entries (e.g., the key "about.copyright.value" and the other remaining English key around line 814) are still in English and should be translated into Japanese for UI consistency; update the values for these keys to their appropriate Japanese translations, preserve the string keys and formatting (quotes and semicolon), and ensure encoding/escaping remains valid in Localizable.strings so the app displays the Japanese text.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ScreenTranslate/Resources/de.lproj/Localizable.strings`:
- Line 721: Update the localized value for the key
"bilingualResult.copyTextSuccess" to fix the typo: replace "Üetzungstext
kopiert" with "Übersetzungstext kopiert" so the user-visible string reads
correctly; locate the entry for bilingualResult.copyTextSuccess in
Localizable.strings and correct the value accordingly.
In `@ScreenTranslate/Resources/es.lproj/Localizable.strings`:
- Line 739: The localization key contains an accidental " %@" suffix causing
lookup failures—remove the trailing " %@" from the key so it becomes
"textTranslation.error.translationFailed" and keep the "%@" placeholder only
inside the value string ("Traducción fallida: %@"); update the entry that
currently reads "textTranslation.error.translationFailed %@" = "Traducción
fallida: %@"; to use the corrected key "textTranslation.error.translationFailed"
so NSLocalizedString/lookup for textTranslation.error.translationFailed resolves
correctly.
In `@ScreenTranslate/Resources/it.lproj/Localizable.strings`:
- Line 536: The string value for the localization key
"onboarding.feature.shortcuts.description" contains a misspelling ("tradova");
update the translation to correct Italian (e.g., replace "Cattura e tradova da
ovunque con le scorciatoie da tastiera" with "Cattura e traduci da ovunque con
le scorciatoie da tastiera") so the key
"onboarding.feature.shortcuts.description" contains the corrected word.
In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings`:
- Line 207: The Japanese localization contains Chinese text for the
"button.confirm" key (value "确定"); update the value for "button.confirm" in the
ja.lproj Localizable.strings to the correct Japanese string (e.g., "確認" or "確定")
and search the same file for any duplicate occurrences of "button.confirm" (the
comment also notes a second occurrence) to replace them as well so no Chinese
text remains in the Japanese resource.
In `@ScreenTranslate/Resources/ko.lproj/Localizable.strings`:
- Line 159: 修正本地化 key "tool.freehand" 对应的韩文翻译字符串:将当前值 "자유형"
的错误混合写法(目前为“自由형”)替换为标准韩语 "자유형",确保只修改 "tool.freehand" 的右侧翻译文本并保留键名与引号/分号格式不变。
In `@ScreenTranslate/Resources/pt.lproj/Localizable.strings`:
- Line 576: The localization key "onboarding.test.success" still contains an
English value; replace the English string with the correct Portuguese
translation while preserving the two placeholders ("%@") and the escaped quotes,
e.g. update the value for "onboarding.test.success" to a Portuguese phrase
conveying "Translation test successful: \"%@\" → \"%@\"" so the Portuguese UI
shows a fully localized message.
- Around line 498-500: The key "onboarding.test.success" in Localizable.strings
is still in English; replace its value with a Portuguese translation (e.g.,
"Teste de tradução bem‑sucedido: \"%@\" → \"%@\"") so the entry becomes
Portuguese like the other keys; update the value for "onboarding.test.success"
accordingly and keep the format/specifiers unchanged.
---
Nitpick comments:
In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings`:
- Line 801: The two localized string entries (e.g., the key
"about.copyright.value" and the other remaining English key around line 814) are
still in English and should be translated into Japanese for UI consistency;
update the values for these keys to their appropriate Japanese translations,
preserve the string keys and formatting (quotes and semicolon), and ensure
encoding/escaping remains valid in Localizable.strings so the app displays the
Japanese text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fa4c5a25-0cea-4a1b-9c2f-d0927f34454b
📒 Files selected for processing (10)
ScreenTranslate.xcodeproj/project.pbxprojScreenTranslate/Resources/de.lproj/Localizable.stringsScreenTranslate/Resources/es.lproj/Localizable.stringsScreenTranslate/Resources/fr.lproj/Localizable.stringsScreenTranslate/Resources/it.lproj/Localizable.stringsScreenTranslate/Resources/ja.lproj/Localizable.stringsScreenTranslate/Resources/ko.lproj/Localizable.stringsScreenTranslate/Resources/pt.lproj/Localizable.stringsScreenTranslate/Resources/ru.lproj/Localizable.stringsScreenTranslate/Resources/zh-Hans.lproj/Localizable.strings
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
ScreenTranslate/Resources/ja.lproj/Localizable.strings (1)
570-570:⚠️ Potential issue | 🟡 Minor第 570 行仍包含中文字符。
"onboarding.complete.start" = "ScreenTranslate を开始使用";中的 "开" 是简体中文字符,日语应使用 "開" 或改用更自然的日语表达。建议修复
-"onboarding.complete.start" = "ScreenTranslate を开始使用"; +"onboarding.complete.start" = "ScreenTranslate の使用を開始";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings` at line 570, The localized string for key "onboarding.complete.start" contains a simplified Chinese character ("开") and should be corrected to proper Japanese; update the value for "onboarding.complete.start" to use the Japanese character "開" or a natural Japanese phrase (e.g., "ScreenTranslate を開始する" or "ScreenTranslate をはじめる") so the translation is fully Japanese and consistent.
🧹 Nitpick comments (2)
translate_strings.py (2)
69-69: 未使用的函数参数content。
categorize_entries(entries, content)的content参数未被使用。应移除该参数或添加相关功能。建议修复
-def categorize_entries(entries, content): +def categorize_entries(entries): """根据注释对条目进行分类"""同时更新调用处(第 132 行):
- categories = categorize_entries(entries, content) + categories = categorize_entries(entries)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@translate_strings.py` at line 69, The function categorize_entries(entries, content) contains an unused parameter content; either remove the content parameter from the function signature or actually use it inside categorize_entries to implement the intended behavior, and then update all callers to match (e.g., change calls that pass a content argument to call categorize_entries(entries) if you remove the parameter, or pass the proper content if you add logic). Ensure you modify the function definition named categorize_entries and adjust its callers consistently so signatures align.
111-113: 路径构建假设脚本位于仓库根目录。
Path(__file__).parent / "ScreenTranslate" / "Resources"假设脚本位于仓库根目录。如果从其他目录运行脚本,路径将无效。建议使用更健壮的路径查找方式,或在脚本中添加路径验证。
base_dir = Path(__file__).parent / "ScreenTranslate" / "Resources" if not base_dir.exists(): # 尝试其他可能的路径 base_dir = Path(__file__).parent.parent / "ScreenTranslate" / "Resources"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@translate_strings.py` around lines 111 - 113, The base_dir construction (base_dir, source_file, target_file using Path(__file__).parent / "ScreenTranslate" / "Resources") assumes the script runs from the repo root; make it robust by validating base_dir.exists() and adding fallbacks (e.g. try Path(__file__).parent.parent and Path.cwd()) or accept a CLI/ENV override, then recompute source_file and target_file from the resolved base_dir; update the code that sets base_dir, source_file and target_file to perform the existence check and clear fallback logic so the script works when launched from other directories.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.omc/state/subagent-tracking.json:
- Around line 1-80: This is a runtime state file that shouldn't be committed and
its summary counters are inconsistent with the agents array; remove the file
from the commit (stop tracking it), add an ignore rule for the runtime state
(e.g., ignore the .omc/state/ runtime files), and correct the JSON counters so
they match the agents array: update the "agents" array remains if needed but set
"total_spawned" and "total_completed" to the actual count of entries in "agents"
(and "total_failed" to 0) and refresh "last_updated" to current time; reference
the JSON keys "agents", "total_spawned", "total_completed", "total_failed", and
"last_updated" when making these changes.
In `@translate_strings.py`:
- Around line 156-164: The current loop in selected_entries builds a
translations list by copying entry['value'] into 'translated_value' (in
function/process handling selected_entries and variable translations) and then
the script calls update_translation(), which overwrites target localization with
English; remove the call to update_translation() so the script only generates
the translations_*_*.txt files (or alternatively implement real translation
before calling update_translation()), i.e., leave the translations list
generation intact but eliminate the update_translation(...) invocation to avoid
overwriting existing translations.
- Around line 45-61: The update_translation() logic is using source-file line
numbers (trans['line']) to update the target file which can misalign; change it
to locate entries by key instead: for each trans in translations, search through
lines for the key using the same regex (pattern) to find the correct line index
(e.g., iterate lines and match rf'^("{re.escape(key)}"\s*=\s*")[^"]*("\s*;)' ),
then perform the re.sub replacement on that matched line and update
lines[index]; remove/ignore the line-number-based branch and update warnings to
indicate "key not found" when no matching line is found for key; keep
updated_count increment only when a replacement actually occurred.
---
Duplicate comments:
In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings`:
- Line 570: The localized string for key "onboarding.complete.start" contains a
simplified Chinese character ("开") and should be corrected to proper Japanese;
update the value for "onboarding.complete.start" to use the Japanese character
"開" or a natural Japanese phrase (e.g., "ScreenTranslate を開始する" or
"ScreenTranslate をはじめる") so the translation is fully Japanese and consistent.
---
Nitpick comments:
In `@translate_strings.py`:
- Line 69: The function categorize_entries(entries, content) contains an unused
parameter content; either remove the content parameter from the function
signature or actually use it inside categorize_entries to implement the intended
behavior, and then update all callers to match (e.g., change calls that pass a
content argument to call categorize_entries(entries) if you remove the
parameter, or pass the proper content if you add logic). Ensure you modify the
function definition named categorize_entries and adjust its callers consistently
so signatures align.
- Around line 111-113: The base_dir construction (base_dir, source_file,
target_file using Path(__file__).parent / "ScreenTranslate" / "Resources")
assumes the script runs from the repo root; make it robust by validating
base_dir.exists() and adding fallbacks (e.g. try Path(__file__).parent.parent
and Path.cwd()) or accept a CLI/ENV override, then recompute source_file and
target_file from the resolved base_dir; update the code that sets base_dir,
source_file and target_file to perform the existence check and clear fallback
logic so the script works when launched from other directories.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4a3d61c2-88ff-459a-8b4a-3ba523ba110c
⛔ Files ignored due to path filters (1)
__pycache__/translate_strings.cpython-312.pycis excluded by!**/*.pyc
📒 Files selected for processing (17)
.omc/project-memory.json.omc/state/agent-replay-9b254e4a-1542-4f00-85f1-1c2a49987130.jsonl.omc/state/hud-state.json.omc/state/hud-stdin-cache.json.omc/state/idle-notif-cooldown.json.omc/state/last-tool-error.json.omc/state/sessions/9b254e4a-1542-4f00-85f1-1c2a49987130/cancel-signal-state.json.omc/state/subagent-tracking.jsonScreenTranslate/Resources/de.lproj/Localizable.stringsScreenTranslate/Resources/es.lproj/Localizable.stringsScreenTranslate/Resources/it.lproj/Localizable.stringsScreenTranslate/Resources/ja.lproj/Localizable.stringsScreenTranslate/Resources/ko.lproj/Localizable.stringsScreenTranslate/Resources/pt.lproj/Localizable.stringstranslate_strings.pytranslations_de_high.txttranslations_pt_high.txt
✅ Files skipped from review due to trivial changes (7)
- .omc/state/idle-notif-cooldown.json
- .omc/state/hud-stdin-cache.json
- .omc/state/hud-state.json
- .omc/project-memory.json
- .omc/state/agent-replay-9b254e4a-1542-4f00-85f1-1c2a49987130.jsonl
- .omc/state/last-tool-error.json
- .omc/state/sessions/9b254e4a-1542-4f00-85f1-1c2a49987130/cancel-signal-state.json
🚧 Files skipped from review as they are similar to previous changes (3)
- ScreenTranslate/Resources/es.lproj/Localizable.strings
- ScreenTranslate/Resources/pt.lproj/Localizable.strings
- ScreenTranslate/Resources/de.lproj/Localizable.strings
.omc/state/subagent-tracking.json
Outdated
| { | ||
| "agents": [ | ||
| { | ||
| "agent_id": "a6d51e17053b0ba31", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:37:10.330Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:42:29.694Z", | ||
| "duration_ms": 319364 | ||
| }, | ||
| { | ||
| "agent_id": "acaf9fafe74e11ff4", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:37:10.334Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:41:50.804Z", | ||
| "duration_ms": 280470 | ||
| }, | ||
| { | ||
| "agent_id": "a36acdbebd548e158", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:37:10.352Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:42:24.342Z", | ||
| "duration_ms": 313990 | ||
| }, | ||
| { | ||
| "agent_id": "ae443091071e4cbb0", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:42:43.161Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:50:17.523Z", | ||
| "duration_ms": 454362 | ||
| }, | ||
| { | ||
| "agent_id": "a773682c9a2016e25", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:42:43.159Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:50:48.924Z", | ||
| "duration_ms": 485765 | ||
| }, | ||
| { | ||
| "agent_id": "a657c2bf383b64cf2", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:37:10.361Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T06:41:49.014Z", | ||
| "duration_ms": 278653 | ||
| }, | ||
| { | ||
| "agent_id": "ab485011499b37c66", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T07:01:07.876Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T07:02:25.162Z", | ||
| "duration_ms": 77286 | ||
| }, | ||
| { | ||
| "agent_id": "a323adc9000c73c3b", | ||
| "agent_type": "oh-my-claudecode:executor", | ||
| "started_at": "2026-03-05T06:42:43.108Z", | ||
| "parent_mode": "none", | ||
| "status": "completed", | ||
| "completed_at": "2026-03-05T07:00:56.384Z", | ||
| "duration_ms": 1093276 | ||
| } | ||
| ], | ||
| "total_spawned": 4, | ||
| "total_completed": 13, | ||
| "total_failed": 0, | ||
| "last_updated": "2026-03-05T07:19:33.754Z" | ||
| } No newline at end of file |
There was a problem hiding this comment.
此文件不应提交到版本控制。
.omc/state/subagent-tracking.json 是本地开发工具(oh-my-claudecode)的运行时状态文件,包含特定于开发环境的时间戳和执行数据。此类文件通常应被 .gitignore 排除。
此外,数据存在不一致:数组中有 8 个 agent 记录,但 total_spawned 为 4,total_completed 为 13,这些数值不匹配。
建议添加到 .gitignore
+# oh-my-claudecode state files
+.omc/🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.omc/state/subagent-tracking.json around lines 1 - 80, This is a runtime
state file that shouldn't be committed and its summary counters are inconsistent
with the agents array; remove the file from the commit (stop tracking it), add
an ignore rule for the runtime state (e.g., ignore the .omc/state/ runtime
files), and correct the JSON counters so they match the agents array: update the
"agents" array remains if needed but set "total_spawned" and "total_completed"
to the actual count of entries in "agents" (and "total_failed" to 0) and refresh
"last_updated" to current time; reference the JSON keys "agents",
"total_spawned", "total_completed", "total_failed", and "last_updated" when
making these changes.
translate_strings.py
Outdated
| for trans in translations: | ||
| key = trans['key'] | ||
| new_value = trans['translated_value'] | ||
| line_num = trans['line'] - 1 # 转换为0-based索引 | ||
|
|
||
| if line_num < len(lines): | ||
| line = lines[line_num] | ||
| # 查找并替换该行的值 | ||
| pattern = rf'^("{re.escape(key)}"\s*=\s*")[^"]*("\s*;)' | ||
| new_line = re.sub(pattern, rf'\g<1>{new_value}\g<2>', line) | ||
| if new_line != line: | ||
| lines[line_num] = new_line | ||
| updated_count += 1 | ||
| else: | ||
| print(f"警告: 第{line_num+1}行未找到键 '{key}'") | ||
| else: | ||
| print(f"警告: 行号{line_num+1}超出文件范围") |
There was a problem hiding this comment.
基于行号的更新逻辑存在设计缺陷。
update_translation() 函数使用源文件(英文)的行号来定位目标文件中的条目。但源文件和目标文件的结构可能不同(注释布局、空行数量等),导致行号不匹配。
当目标文件的键位于不同行时:
- 第 53-54 行的正则替换会静默失败
- 第 59 行仅打印警告,不会实际更新翻译
建议改进:改用基于键名的匹配逻辑,而非依赖行号。
建议修复
def update_translation(target_file, translations):
"""更新目标文件的翻译"""
with open(target_file, 'r', encoding='utf-8') as f:
content = f.read()
- # 按行更新翻译
- lines = content.split('\n')
updated_count = 0
+ # 基于键名匹配并替换
for trans in translations:
key = trans['key']
new_value = trans['translated_value']
- line_num = trans['line'] - 1 # 转换为0-based索引
-
- if line_num < len(lines):
- line = lines[line_num]
- # 查找并替换该行的值
- pattern = rf'^("{re.escape(key)}"\s*=\s*")[^"]*("\s*;)'
- new_line = re.sub(pattern, rf'\g<1>{new_value}\g<2>', line)
- if new_line != line:
- lines[line_num] = new_line
- updated_count += 1
- else:
- print(f"警告: 第{line_num+1}行未找到键 '{key}'")
- else:
- print(f"警告: 行号{line_num+1}超出文件范围")
+ pattern = rf'("{re.escape(key)}"\s*=\s*")[^"]*("\s*;)'
+ new_content, count = re.subn(pattern, rf'\g<1>{new_value}\g<2>', content)
+ if count > 0:
+ content = new_content
+ updated_count += count
+ else:
+ print(f"警告: 未找到键 '{key}'")
- updated_content = '\n'.join(lines)
with open(target_file, 'w', encoding='utf-8') as f:
- f.write(updated_content)
+ f.write(content)
return updated_count🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@translate_strings.py` around lines 45 - 61, The update_translation() logic is
using source-file line numbers (trans['line']) to update the target file which
can misalign; change it to locate entries by key instead: for each trans in
translations, search through lines for the key using the same regex (pattern) to
find the correct line index (e.g., iterate lines and match
rf'^("{re.escape(key)}"\s*=\s*")[^"]*("\s*;)' ), then perform the re.sub
replacement on that matched line and update lines[index]; remove/ignore the
line-number-based branch and update warnings to indicate "key not found" when no
matching line is found for key; keep updated_count increment only when a
replacement actually occurred.
translate_strings.py
Outdated
| # 这里需要实际翻译逻辑 | ||
| # 暂时只是复制英文值 | ||
| translations = [] | ||
| for entry in selected_entries: | ||
| translations.append({ | ||
| 'key': entry['key'], | ||
| 'translated_value': entry['value'], # 这里应该替换为翻译 | ||
| 'line': entry['line'] | ||
| }) |
There was a problem hiding this comment.
翻译逻辑仅复制英文原文作为占位符。
当前实现(第 162 行)仅复制英文值,没有实际翻译功能。注释提到"这里应该替换为翻译",但实际上这会导致:
- 目标本地化文件被英文覆盖
- 生成的
translations_*_*.txt文件包含英文而非目标语言
如果此脚本仅用于生成待翻译列表,建议移除第 167 行的 update_translation() 调用,避免覆盖已有翻译。
建议修复
print(f"选择翻译 {len(selected_entries)} 个条目")
- # 这里需要实际翻译逻辑
- # 暂时只是复制英文值
- translations = []
- for entry in selected_entries:
- translations.append({
- 'key': entry['key'],
- 'translated_value': entry['value'], # 这里应该替换为翻译
- 'line': entry['line']
- })
-
- # 更新文件
- updated = update_translation(target_file, translations)
- print(f"更新了 {updated} 个翻译")
-
# 生成待翻译列表供人工处理
output_file = f"translations_{lang}_{priority}.txt"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@translate_strings.py` around lines 156 - 164, The current loop in
selected_entries builds a translations list by copying entry['value'] into
'translated_value' (in function/process handling selected_entries and variable
translations) and then the script calls update_translation(), which overwrites
target localization with English; remove the call to update_translation() so the
script only generates the translations_*_*.txt files (or alternatively implement
real translation before calling update_translation()), i.e., leave the
translations list generation intact but eliminate the update_translation(...)
invocation to avoid overwriting existing translations.
- de: Fix typo "Üetzungstext" → "Übersetzungstext" - es: Remove erroneous " %@" suffix from key name - it: Fix typo "tradova" → "traduci" - ja: Replace Chinese "确定" → "確認", "开始" → "開始" - ja: Translate "All rights reserved" → "全著作権所有", "by %@" → "作者: %@" - ko: Fix mixed script "自由형" → "자유형" - pt: Translate "Translation test successful" → "Teste de tradução bem-sucedido" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3ae668d to
a14e7ff
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
ScreenTranslate/Resources/ja.lproj/Localizable.strings (2)
570-570:⚠️ Potential issue | 🟡 Minor日文文案表达不自然,建议改为标准语序
当前
"ScreenTranslate を開始使用"偏直译,建议改为更自然的日语表达。建议修改
-"onboarding.complete.start" = "ScreenTranslate を開始使用"; +"onboarding.complete.start" = "ScreenTranslate の使用を開始";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings` at line 570, The translation for key "onboarding.complete.start" is unnatural Japanese; update its value to a natural phrase such as "ScreenTranslate の使用を開始" or "ScreenTranslate を使い始める" by replacing the current string "ScreenTranslate を開始使用" with one of these more natural expressions in the Localizable.strings entry for onboarding.complete.start.
739-739:⚠️ Potential issue | 🟠 Major修复错误的本地化 key,避免文案查找失配
key 末尾多了
%@,会导致代码按标准 key 查找失败。建议修改
-"textTranslation.error.translationFailed %@" = "翻訳失敗:%@"; +"textTranslation.error.translationFailed" = "翻訳失敗:%@";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings` at line 739, The localization key contains an accidental trailing " %@" causing lookup failures; rename the key "textTranslation.error.translationFailed %@" to the correct key "textTranslation.error.translationFailed" and keep the value unchanged (ensure the value still contains the %@ placeholder "翻訳失敗:%@") so the placeholder remains available for runtime formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ScreenTranslate/Resources/de.lproj/Localizable.strings`:
- Line 739: The localization key was accidentally suffixed with " %@"; change
the key from "textTranslation.error.translationFailed %@" to the canonical
"textTranslation.error.translationFailed" and keep the value "Übersetzung
fehlgeschlagen: %@" so the runtime lookup using
textTranslation.error.translationFailed succeeds; also search for any direct
references to the incorrect key and update them to the corrected key if present.
In `@ScreenTranslate/Resources/it.lproj/Localizable.strings`:
- Line 740: The localization key contains an extra " %@" suffix causing lookup
mismatches; update the key "textTranslation.error.translationFailed %@" in
Localizable.strings to "textTranslation.error.translationFailed" (keep the value
"Traduzione fallita: %@" so the placeholder remains) and verify callers use the
corrected key.
---
Duplicate comments:
In `@ScreenTranslate/Resources/ja.lproj/Localizable.strings`:
- Line 570: The translation for key "onboarding.complete.start" is unnatural
Japanese; update its value to a natural phrase such as "ScreenTranslate の使用を開始"
or "ScreenTranslate を使い始める" by replacing the current string "ScreenTranslate
を開始使用" with one of these more natural expressions in the Localizable.strings
entry for onboarding.complete.start.
- Line 739: The localization key contains an accidental trailing " %@" causing
lookup failures; rename the key "textTranslation.error.translationFailed %@" to
the correct key "textTranslation.error.translationFailed" and keep the value
unchanged (ensure the value still contains the %@ placeholder "翻訳失敗:%@") so the
placeholder remains available for runtime formatting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1624d0ab-b898-4b9c-a47e-06e3a08ed784
📒 Files selected for processing (6)
ScreenTranslate/Resources/de.lproj/Localizable.stringsScreenTranslate/Resources/es.lproj/Localizable.stringsScreenTranslate/Resources/it.lproj/Localizable.stringsScreenTranslate/Resources/ja.lproj/Localizable.stringsScreenTranslate/Resources/ko.lproj/Localizable.stringsScreenTranslate/Resources/pt.lproj/Localizable.strings
✅ Files skipped from review due to trivial changes (1)
- ScreenTranslate/Resources/ko.lproj/Localizable.strings
🚧 Files skipped from review as they are similar to previous changes (1)
- ScreenTranslate/Resources/pt.lproj/Localizable.strings
- de/it/ja: Remove erroneous " %@" suffix from textTranslation.error.translationFailed key - ja: Improve "onboarding.complete.start" phrasing to natural Japanese Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
98b4e57 to
bce8d01
Compare
Summary
Languages Added
Test Plan
plutil -lintvalidation🤖 Generated with Claude Code
Summary by CodeRabbit