Skip to content

feat: 更多介面語言(i18n 架構擴充,先加日文)#6

Open
kiki830621 wants to merge 2 commits into
mainfrom
idd/2-feat-i18n-ja
Open

feat: 更多介面語言(i18n 架構擴充,先加日文)#6
kiki830621 wants to merge 2 commits into
mainfrom
idd/2-feat-i18n-ja

Conversation

@kiki830621

@kiki830621 kiki830621 commented Jul 16, 2026

Copy link
Copy Markdown
Member

Refs #2

Summary

Locale 開放為 zh-TW/en/ja、新增完整日文字典(TypeScript 型別保證 key 一致性)、語言切換從雙語 toggle 改為三語 select 選單(原生語言名)、detectLocale 支援 ja 前綴與 stored 白名單。

Checklist

  • Diagnose(Plan via Hard-gate,unattended 跳過 deliberation 已標記)
  • Implement (1 commit)
  • Verify (run /idd-verify feat: 更多介面語言(i18n 架構擴充,先加日文) #2)
  • Verify-gated: post-verify PASS = ready to merge → after merge, run /idd-close to finalize this issue (manual gate + closing summary; no auto-close trailer)

Related

與 PR #4 的變更檔案集完全不相交(無 git 層合併衝突;本描述初版誤稱有 app.ts 交集,經 verify regression lens 查證更正)。實際耦合僅:本 PR 的 select 沿用 .lang-btn class,PR #4 將該 class 改為 CSS 變數驅動——語意相容,兩 PR 可任意順序合併。


Generated by /idd-all on PR path. Do NOT add a GitHub close trailer (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary.

- Locale 開放為 zh-TW/en/ja;ja 完整字典(型別保證 key 一致)
- detectLocale 白名單 stored + ja 前綴對應
- 語言切換改 select 選單(原生語言名),change 事件換字 + aria-label 重設
- langToggle key 廢棄 → langSelectLabel(三語)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mac-trackpad-test Ready Ready Preview, Comment Jul 16, 2026 5:33am

Request Review

@kiki830621

Copy link
Copy Markdown
Member Author

Verify Report — PR #6(Round 1)

Engine

manual fan-out (4 lens Agents + sequenced DA, model: sonnet, file-based output) + Codex (gpt-5.5 xhigh, run_in_background)。

Freshness

凍結 SHA 0ae997e(= PR head,期間零 delta)。

Aggregate

FAIL — 1 blocking(要求未全滿足), 3 in-scope fix, 若干潤飾

要求覆蓋率

5 項 Expected:3 FULLY + 2 PARTIALLY((1) Locale 單一來源、(5) export ja 測試缺口)

Findings(合併後)

# Severity Finding Source Action
1 MEDIUM Locale 清單三處手動維護(strings.ts union / index.ts SUPPORTED / app.ts options),非單一事實來源——Expected(1)「可增列清單」判 PARTIALLY;加第四語時型別不保證同步 agents:logic + codex + agents:requirements(三來源獨立收斂;DA 反駁不成立) Blocking → 本 round 修
2 LOW 匯出 JSON language:'ja' 無測試覆蓋(邏輯 by inspection 正確) agents:requirements + codex + DA 確認 In-scope fix(補測試)
3 LOW select.value as Locale unchecked cast(現況被 options 限死、屬結構性巧合) agents:logic + codex In-scope fix(isLocale 守衛,併入 #1 重構)
4 LOW 日文潤飾 ~6 處(exportHint 的「貼り付けて」對象不自然、exportCopyFailed 缺「コピーに」、maxJumpLabel/jumpCountLabel 語意、forceClickDone「発動」遊戲感等) codex 逐 key + DA 抽查 15+ key 補 2 處 In-scope fix(採納合理建議)
5 LOW PR body 誤稱與 PR #4 有 app.ts 交集(實際檔案集完全不相交) agents:regression(DA 降級 LOW) ✅ 已修(PR body 已更正)
6 main-layout 測試初始 locale 未固定(codex 提出)——DA 反駁成立:5 seeds shuffle 全綠、斷言為相對式、module-state 模式 pre-existing,非真 bug codex vs DA 順手加固(測試起點 setLocale),不列缺陷
7 INFO stored 大小寫不對稱、ja 前綴理論誤配、detectLocale(null) throw(unreachable、pre-existing) agents:logic + DA truth table 17 案例 不動
8 PASS 複驗:zh/en 字典零漂移、langToggle 零殘留、scope 乾淨(恰 5 檔)、字典 36×3 無注入字元、無 secrets 全 lens + DA 獨立複驗

Next

依 unattended verify-fix loop:修 #1#4 → commit → Round 2。

…#2)

- LOCALES/localeNames 為單一來源;Locale type、偵測白名單、選單 options 全派生(三 AI 收斂 finding)
- select change 加 isLocale 型別守衛;選單 label 改語言原生名(繁體中文/English/日本語)
- 日文潤飾 8 處(exportHint 共有語意、exportCopyFailed、最大移動量/異常数、作動/未検出等)
- 測試:LOCALES 對齊斷言、isLocale 案例、export language:'ja' 覆蓋、切換測試固定起點

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kiki830621

Copy link
Copy Markdown
Member Author

Verify Report — PR #6(Round 2,delta)

Engine

Codex (gpt-5.5 xhigh) delta 複驗 + 全套件 46 tests + tsc + build。R1 已跑 4 lens + DA + Codex 六方全審。

Freshness

R1 凍結 0ae997e → R2 delta 8c6cdcf(修復 commit)。機械 gates 於最終 HEAD 全綠。

Aggregate

PASS — 0 blocking

R1 findings 處置

R1 finding 處置
MEDIUM Locale 三處手動維護 ✅ 已修:LOCALES 單一來源,type/白名單/選單全派生——Codex R2 確認「加第 4 語只改 strings.ts」結構性成立
LOW export language:'ja' 測試缺 ✅ 已補
LOW unchecked cast ✅ isLocale 型別守衛
LOW 日文潤飾 ~6 處 ✅ 8 處已潤(Codex R2 判整體自然)
LOW PR body 誤述 ✅ 已更正

R2 殘餘(accepted,不再迭代)

Codex R2 finding 判定
LOW:detectLocale 的瀏覽器前綴對應仍硬編碼(未來第 4 語不會自動偵測) Accepted——issue Expected(3) 明定 ja/zh/en 對應;未來語系的偵測屬未來工作
LOW/Test-only:測試寫死 locale 清單與 label 刻意保留——literal 斷言是回歸鎖本意;改派生比對會變套套邏輯(app 與來源一起錯也會過)。加新語時測試應被有意識更新
Nit:異常数→異常回数 等 3 處可選微調 Accepted as optional polish,不阻擋

Verdict: verify-gated PASS — ready to merge(merge 後跑 /idd-close 結案,勿用 auto-close trailer)

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