Skip to content

emrg: GUI i18n static-leak fix — wire 12 remaining data-i18n strings + regression tests - #507

Merged
argszero merged 1 commit into
masterfrom
feature/gui-i18n-static-leaks-fix
Aug 6, 2026
Merged

emrg: GUI i18n static-leak fix — wire 12 remaining data-i18n strings + regression tests#507
argszero merged 1 commit into
masterfrom
feature/gui-i18n-static-leaks-fix

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Completes rant 21:19 acceptance item "no hardcoded Chinese outside the i18n dict" — an audit found 12 static strings in index.html still hardcoded in Chinese with no data-i18n wiring, so English-system users see Chinese UI fragments. The i18n Stage 1/2 (#503/#504) migration missed them because they are not touched by JS at runtime (only updateGrowthCard/showEvolutionToast overwrite a subset).

Fixed leaks (index.html → data-i18n / data-i18n-title / data-i18n-placeholder)

  1. growth-card titlecopy.growthCardTitle
  2. growth-note text → copy.growthNote (key existed, element unwired)
  3. status-dot titlesidebar.statusTitle
  4. back-to-bottom titlesidebar.backToBottom
  5. model-form-name placeholdersettings.modelNamePlaceholder
  6. Settings "关于" group title → settings.aboutTitle
  7. Settings about-box hint → settings.aboutDesc
  8. Settings "最近改进" group title → settings.recentTitle
  9. evolution-toast title → copy.evolutionToastTitle (key existed, element unwired)
  10. evolution-toast msg static → copy.evolutionToastMsgStatic (new non-parameterized key)
  11. evolution-toast see button → copy.evolutionToastSee
  12. evolution-toast dismiss button → copy.evolutionToastDismiss

New dict keys (zh+en, parity enforced by existing test)

copy.growthCardTitle, sidebar.statusTitle, sidebar.backToBottom, settings.aboutTitle, settings.aboutDesc, settings.recentTitle, settings.modelNamePlaceholder, copy.evolutionToastMsgStatic.

Regression tests (+2)

  • index.html CJK scan: every line containing CJK must carry data-i18n/-title/-placeholder (or be an HTML comment) — catches exactly this leak class forever.
  • New static key parity: spot-checks the new keys in en + zh.

Verification

  • GUI suite: 84/84 pass (82 + 2 new). pytest 480 pass; import + emrg --help OK.
  • Post-fix scan: 0 remaining CJK lines without data-i18n in index.html.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-225341 (emrg-00c41753, author self-check, 1/3)

Verified the fix directly: (1) the leak scan script reports 0 remaining CJK lines without data-i18n in index.html (was 12); (2) each wired element is not overwritten by JS at runtime (checked app.js/dialogs.js — status-dot/back-to-bottom/model-form-name get className/value only), so the data-i18n title/placeholder actually renders localized; (3) toast msg static uses a non-parameterized key (copy.evolutionToastMsgStatic) so no literal {n} appears before showEvolutionToast overwrites it; (4) new keys are zh+en and the existing parity test enforces them; (5) GUI 84/84 + pytest 480 pass. This closes the last unmet acceptance item of rant 21:19.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-230036 (emrg-00c41753, 2/3)

Verified the fix against master: exactly 12 Chinese static strings in index.html lack data-i18n (growth-card title/note, status-dot title, back-to-bottom, model-form-name placeholder, About title/desc, Recent-improvements title, evolution-toast title/msg/buttons) — all added by #501/#502 after i18n Stage 1 branched, so the migration missed them. The PR wires all 12 to data-i18n/title/placeholder with zh+en dict keys, and adds a leak-scan regression test (index.html Chinese must carry data-i18n) that would have caught this. This closes rant 21:19's "no hardcoded Chinese" acceptance item. CI Test green (run 31113853226).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-231245 (emrg-00c41753, 3/3)

3 consecutive LGTMs from cycles 225341 / 230036 / 231245 — merging. Fix verified earlier: 12 index.html static Chinese strings wired to data-i18n with zh/en keys + index.html leak-scan regression test; CI green.

@argszero
argszero merged commit 6ea952e into master Aug 6, 2026
1 check passed
argszero pushed a commit that referenced this pull request Aug 6, 2026
… regression test (rant 21:19)

- app.js loadEvolutionSummary: '最近改进' header + '还没有改进记录…' empty state
  now resolve via _t() (app.recentImprovements / app.noImprovements, zh+en dict keys)
  — these were added by #502 after i18n Stage 2 and missed the migration
- i18n.test.js: +2 tests — JS-side Chinese-leak scan (mirrors #507's index.html
  scan, excludes i18n.js dict/comments/functional regexes) + bilingual assertions
- GUI 84 pass (82 + 2), Python 480 pass
argszero added a commit that referenced this pull request Aug 6, 2026
… regression test (rant 21:19) (#508)

- app.js loadEvolutionSummary: '最近改进' header + '还没有改进记录…' empty state
  now resolve via _t() (app.recentImprovements / app.noImprovements, zh+en dict keys)
  — these were added by #502 after i18n Stage 2 and missed the migration
- i18n.test.js: +2 tests — JS-side Chinese-leak scan (mirrors #507's index.html
  scan, excludes i18n.js dict/comments/functional regexes) + bilingual assertions
- GUI 84 pass (82 + 2), Python 480 pass

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/gui-i18n-static-leaks-fix branch August 6, 2026 15:29
argszero added a commit that referenced this pull request Aug 6, 2026
…18n leak closures, e2e tests, doc-count guard) (#512)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
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