Skip to content

fix(i18n): ship the per-tab catalog sync in @simple-module-py/i18n and use it in the scaffold (#871) - #910

Merged
antosubash merged 3 commits into
mainfrom
fix/issue-871-i18n-header
Nov 11, 2026
Merged

antosubash merged 3 commits into
mainfrom
fix/issue-871-i18n-header

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • The per-tab i18n catalog sync from hosting: i18n catalog marker is per-session, not per-tab — other tabs keep the old language after a locale switch #788 moved from host/client_app/i18n.ts into the published package as @simple-module-py/i18n/inertia.
    • The sync sends X-SM-I18n on every Inertia visit, adopts each non-null catalog, and reloads i18n once when the locale changes without a catalog.
    • It exports bootI18nFromInitialPage(i18n) and subscribeI18nToNavigation(router).
    • The router is passed in under a structural I18nRouter type, so the package doesn't depend on @inertiajs/react.
  • This repo's host and the smpy new template app.tsx both use it. Scaffolded apps used to keep their own success handler, which sent no header and fell back to the per-session markers.
  • The tests moved to packages/i18n/src/inertia.test.ts. The scaffold regression test now checks the shared wiring.
  • Docs updated: the package README, docs/framework/i18n.md, docs/frontend/shared-props.md and docs/frontend/performance.md. The CHANGELOG entry tells existing apps how to switch.

Closes #871

Verification

  • In a scaffolded app with the new template and package: tsc passes. A sidebar navigation sends x-sm-i18n: en:full, and the response carries "messages": null, so the tab keeps its catalog.
  • Local CI: make lint ✓, make ci-docs-build ✓, make test-py ✓ (8323), make test-js ✓ (906).
  • Reviewed by correctness and maintainability reviewers (docs fixes) and by Codex. Codex caught a stale scaffold test, now fixed, and its final review found nothing.
  • Verification report: https://claude.ai/artifact/FhG3gugcZBtJco17bv9H1f

Report links are Claude Artifacts and start private — the author can share them
from claude.ai/code/artifacts if reviewers need access.

Test plan

  • In this repo's dev host, switch locale and sign in; translations stay correct without a hard refresh
  • CI is green

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-11T01:10:57.765145Z cb45677 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: cb45677
Status: ✅  Deploy successful!
Preview URL: https://622590af.simple-module-python.pages.dev
Branch Preview URL: https://fix-issue-871-i18n-header.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit e13bf14 into main Nov 11, 2026
16 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.

scaffold: client_app doesn't send X-SM-I18n, so new hosts miss the per-tab catalog fix

1 participant