Skip to content

[PR10] 翻譯視圖日誌修復 + FTB Quest 抽取驗證#39

Merged
jlin53882 merged 18 commits intomainfrom
pr10/unified-fix-validation
Mar 23, 2026
Merged

[PR10] 翻譯視圖日誌修復 + FTB Quest 抽取驗證#39
jlin53882 merged 18 commits intomainfrom
pr10/unified-fix-validation

Conversation

@jlin53882
Copy link
Copy Markdown
Owner

PR10 — 翻譯視圖日誌修復 + FTB Quest 抽取驗證

Task A:翻譯視圖日誌灰色圖塊修復

  • 檔案app/views/translation_view.py
  • 根因log_view ListView 的 bgcolor 未設定,透明背景透出下層灰色
  • 修復bgcolor="#1e1e1e"(與 Container 背景一致)
  • Commit870f5a5

Task B:FTB Quest 抽取格式驗證

  • 驗證報告workspace/pr10_ftbquest_validation_report.md

發現

項目 結果
格式問題 ALL CLEAR
lang keys 抽取 13066 筆(100% 覆蓋)
Quest 本體抽取 706 個 .snbt 檔 0 keys

重大發現:Quest 本體未抽取

  • ftb_quests.json 全為 0 keys
  • extract_quest_file 函式的欄位匹配邏輯與實際 SNBT 結構不符
  • 需要後續修復:translation_tool/plugins/ftbquests/ftbquests_snbt_extractor.py

待辦(後續 PR)

  • 修復 extract_quest_file 邏輯,正確匹配 SNBT 結構中的 title/subtitle/description 欄位

- Task A: translation_view.py log_view 灰色圖塊修復(已套用至 main)
- Task B: FTB Quest 抽取驗證報告
  - 706 .snbt Quest 本體檔案 0 keys 抽取(待修復 extract_quest_file)
  - 格式檢查 ALL CLEAR
  - lang keys 13066 筆(100% 覆蓋)
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

ListView.__init__() 在 Flet 0.28.3 不支援 bgcolor;
父層 Container 已有 bgcolor='#1e1e1e',ListView 這行多餘且造成
TypeError: got an unexpected keyword argument 'bgcolor'.
styled_card 是白底卡片,content_container 透明,
無法讓深色背景正確顯示。
改用獨立的 ft.Container(bgcolor=#1e1e1e, border, border_radius)
直接作為日誌區,移除 styled_card 的白色遮罩。
JS 檔案中的中文(例如 client_scripts/tooltips.js 的中文 tooltips)
不再被 skip,改為保留並參與三語合併比對。
JSON lang 檔案的處理邏輯不變(直接 extract,不走 should_skip_text)。
不翻譯純視覺裝飾字元,修復 client_scripts 中█████████被錯誤抽取的問題。
…lues

client_scripts/*.json 的 extracted 值是簡體中文,在寫入 pending/
之前須先做 OpenCC s2tw 轉換為繁體中文,確保:
1. 進入翻譯流程時是繁體(非簡體冒充英文)
2. 輸出結果與遊戲 zh_tw 格式一致
Problem: client_scripts pending JSON contains zh_tw text (after OpenCC
conversion in step1). Sending these to LM wastes API budget.

Solution: before LM translation, check if source_text is already zh_tw
using OpenCC s2tw conversion (if convert(text)==text, it's already TW).
Items already in TW are moved to cache_hit, not sent to LM.

Changes:
- Add _is_tw_text() and _split_off_tw_items() helpers
- Apply in both pre-scan loop and main processing loop

Verified: 64/65 pending items skipped as cache hit, only 1 English item
remains for translation.
- restore 'import threading' in translation_view.py (removed by ruff --fix but needed by test)
- apply ruff format to 6 files flagged by CI lint
- test: 1119 passed
@jlin53882 jlin53882 merged commit 0eb62e7 into main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant