feat: refine i18n loading guardrails#950
Merged
Merged
Conversation
ca6dca3 to
23a73fb
Compare
23a73fb to
da05a50
Compare
Collaborator
Author
|
Related tracking issue: #959. This link is for i18n/l10n module context only and should not close the issue when this PR is merged or closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
en-US.sessions.launch.Behavior and Contract Changes
WEB_UI_BOOTSTRAP_NAMESPACES; route and feature namespaces should be requested throughuseI18n(namespace)ori18nService.loadNamespace(namespace).i18nService.t('namespace:key')andi18nService.getT()namespace usage must stay within bootstrap namespaces;pnpm run i18n:contract:testenforces this.pnpm run i18n:auditnow treats Web UI, mobile-web, and installer key mismatches as errors, and fails if hardcoded CJK source candidate budgets increase.Risk Notes
Adversarial Review
initImmediate: falseand a synchronous bootstrap translation test.i18nService.t(...)andgetT()namespace usage againstWEB_UI_BOOTSTRAP_NAMESPACES.sessions.launchmissing from mobile-weben-US, which is fixed in this PR.Verification
Runtime and cross-surface validation run earlier in this PR:
pnpm run i18n:contract:testpnpm run i18n:audit(passes with 3 grandfathered CJK budget warnings)pnpm run lint:webpnpm run type-check:webpnpm --dir src/web-ui run test:run(146 files, 772 tests)pnpm run build:webpnpm --dir src/mobile-web run type-checkpnpm run build:mobile-webpnpm --dir BitFun-Installer run type-checkpnpm --dir BitFun-Installer run buildcargo check --manifest-path BitFun-Installer/src-tauri/Cargo.tomlcargo test -p bitfun-core i18n -- --nocapture(8 passed)Latest docs-only follow-up validation:
pnpm run check:repo-hygienegit diff --checkgit diff --cached --check