Skip to content

refactor(i18n): harden locale debt governance#977

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/i18n-l10n-governance-consolidation
May 30, 2026
Merged

refactor(i18n): harden locale debt governance#977
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/i18n-l10n-governance-consolidation

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

@limityan limityan commented May 30, 2026

Summary

This PR consolidates the next i18n governance cleanup pass into one fork PR:

  • adds machine-readable audit report sections for Web UI literal defaultValue fallbacks and direct locale-formatting calls;
  • introduces a no-growth baseline for direct Intl.* / toLocale* usage outside shared i18n formatting helpers;
  • removes redundant literal fallback copy from selected Web UI call sites now covered by static key auditing;
  • moves the mobile-web search tool label to shared.tools.search and removes local copies;
  • updates selected zh-TW installer/mobile strings where Simplified Chinese copy was still used;
  • keeps i18n guidance concise in AGENTS.md, CONTRIBUTING.md, and durable i18n docs.

Related: #959

Key Metrics

Metric Before After Delta
Confirmed unused keys 0 0 0
Dynamic key candidates 194 193 -1
Shared-term duplicate candidates 206 201 -5
L10n quality candidates 1093 1087 -6
Literal defaultValue fallbacks 457 396 -61
Direct locale-format calls 32 24 -8

Notes For Reviewers

  • shared is still explicit, not a global fallback namespace.
  • Removed Web UI defaultValue strings are for static keys that i18n:audit verifies exist.
  • Direct locale formatting is now audited as debt with a no-growth baseline. The audit catches new Intl.*, bare Intl.*, and toLocale* call sites outside approved i18n formatting helpers.
  • The remaining direct locale-format calls are intentionally left as tracked debt for future focused cleanup.
  • CI follow-up fixed Web UI tests that were still relying on literal fallback behavior or incomplete react-i18next mocks.

Risk / Behavior Changes

  • Number and timestamp formatting in the touched Web UI paths now follows the active app locale via i18nService / useI18n instead of browser/default Intl behavior.
  • Mobile-web search tool labeling now reads the canonical shared tool label.
  • zh-TW installer/mobile wording changes are visible copy improvements; they do not change resource shape or placeholders.
  • lint:web exits 0 but still reports two pre-existing warnings in src/web-ui/src/shared/utils/startupTrace.ts about unused eslint-disable directives.
  • Web and mobile builds pass locally with existing Vite chunk-size/dynamic-import warnings.

Verification

  • GitHub Actions CI passed on a3c966bf: Frontend Build, Rust Build Check (ubuntu-latest), Rust Build Check (macos-15), Rust Build Check (windows-latest)
  • pnpm run i18n:contract:test
  • pnpm run i18n:audit
  • pnpm run i18n:audit -- --report-json <temp>
  • pnpm --dir src/web-ui run test:run (157 files / 802 tests)
  • pnpm run type-check:web
  • pnpm run lint:web (exit 0; two existing warnings noted above)
  • pnpm --dir src/mobile-web run type-check
  • pnpm run build:web
  • pnpm run build:mobile-web
  • pnpm run check:repo-hygiene
  • pnpm run check:github-config
  • git diff --check gcwing/main..HEAD

@limityan limityan force-pushed the yanzhn/i18n-l10n-governance-consolidation branch from 670be89 to a3c966b Compare May 30, 2026 11:41
@limityan limityan merged commit c33d06f 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