refactor: harden i18n audit coverage#952
Merged
Merged
Conversation
76998ff to
e7d2f81
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
pnpm run i18n:contract:testandpnpm run i18n:auditbefore frontend build steps.i18n:auditto enforce placeholder parity across Web UI JSON, mobile-web messages, installer JSON, core Fluent resources, and relay static homepage resources.i18nService.t('namespace:key')keys, direct literal fallback arguments, relay homepagedata-i18nkey parity, and canonical relay locale ids.flow-chat/processing-hintsnamespace.i18n.jsonwith English HTML fallback.common:tabs.pullRequests, mobile-web{suffix}placeholder parity, remote-session-missing, and locale-derived mobile-webOtheroption matching.AGENTS.md,AGENTS-CN.md,CONTRIBUTING.md,CONTRIBUTING_CN.md, and i18n docs with concise guidance for minimal checks and i18n access rules.Risk / behavior notes
i18n:auditare stricter now. Future PRs that add mismatched placeholders, missing direct static keys, direct literal fallback arguments, non-canonical relay locale ids, relay homepage key drift, or CJK source text in audited files will fail until the copy is moved to the right resource owner.settingsnamespace; search behavior should stay equivalent while avoiding encoded CJK strings in TS source.i18n.json; if fetching fails, the page keeps the English fallback HTML anden-USdocument language. The language button cyclesen-US,zh-CN, andzh-TWso every canonical locale is reachable from the static page.s.Otheroption detection is derived from locale resources plus the protocol-levelotherfallback, preserving cross-language compatibility without reintroducing source CJK text.Adversarial review fixes
zh/ento canonicalzh-CN,zh-TW, anden-USlocale ids.data-i18nusage, and placeholder parity.zh-TWis reachable without depending on browser language.<html lang>with the English fallback copy.Otheroption matching so old or cross-locale labels are still treated as custom-answer options.\uXXXXencoded TS literals and into locale resources; changed files now only retain\u001f, a required control separator.Verification
pnpm run i18n:contract:testpnpm run i18n:auditpnpm run type-check:webpnpm --dir src/mobile-web run type-checkpnpm --dir src/web-ui run test:run src/infrastructure/i18n/core/I18nService.test.tspnpm run check:github-configpnpm run check:repo-hygienegit diff --check