Skip to content

refactor(i18n): tighten shared terms and dynamic key proofs#972

Merged
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/i18n-shared-dynamic-cleanup
May 30, 2026
Merged

refactor(i18n): tighten shared terms and dynamic key proofs#972
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/i18n-shared-dynamic-cleanup

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

@limityan limityan commented May 30, 2026

Refs #959

Summary

  • PR A: move the installer titlebar default to the canonical shared.product.name term and remove the duplicated titlebar.default locale keys.
  • PR B: require dynamic i18n allowlist entries to include source-level proof markers, validate those markers in i18n:audit, and document the rule.
  • PR C: add explicit dynamic-key proofState reporting so current dynamic contracts are distinguishable as source-proven, not merely allowlisted.
  • PR D: remove the remaining high-confidence shared-term copies for backend app-name and relay static Remote Control while preserving runtime compatibility and self-contained loading.
  • Update durable i18n architecture/development docs plus concise AGENTS/CONTRIBUTING guidance; no process-plan docs are included.
  • Strict review follow-up: added a regression test proving stale relay static $shared references fail i18n:audit instead of silently degrading.

Key Comparison

Metric Before After Delta
Shared-term duplicate candidates 214 206 -8
Installer shared-term duplicates 3 0 -3
Core shared-term duplicates 18 15 -3
Relay static homepage shared-term duplicates 2 0 -2
product.name duplicate candidates 6 0 -6
features.remoteControl duplicate candidates 2 0 -2
Dynamic key candidates 194 194 0
Dynamic candidates with source references 0 194 +194
Dynamic candidates marked source-proven 0 194 +194

Current report also keeps confirmedUnusedKeys at 0 and l10nQualityCandidates at 1093; this PR does not attempt translation-quality cleanup.

Risks / Contract Changes

  • Backend callers of legacy app-name continue to resolve through an explicit alias to shared.product.name; the copied Fluent key is removed.
  • Relay static homepage now resolves { "$shared": "features.remoteControl" } through a tiny generated i18n.shared.json; it remains self-contained and does not import Web UI locale catalogs.
  • Dynamic key allowlist entries are stricter: moving or renaming a key factory must update sourceReferences, and unproved contracts fail i18n:audit.
  • The dynamic key count is intentionally unchanged; the improvement is proof quality and reviewability.

Verification

  • pnpm run fmt:rs
  • pnpm run i18n:generate -- --check
  • pnpm run i18n:audit -- --report-json scripts/.tmp-i18n-pr-cd-report.json
  • pnpm run i18n:contract:test (31 tests)
  • pnpm --dir BitFun-Installer run type-check
  • cargo test -p bitfun-core i18n -- --nocapture
  • pnpm run check:repo-hygiene
  • git diff --check
  • adversarial review: verified no process docs/temp reports are staged, dynamic findings are all source-proven, removed core/relay shared-term duplicate classes are absent from the audit report, and stale relay $shared references are audit-blocked.

@limityan limityan force-pushed the yanzhn/i18n-shared-dynamic-cleanup branch from a4d2ace to dcb0b55 Compare May 30, 2026 10:31
@limityan limityan merged commit e10bbae into GCWing:main May 30, 2026
4 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