Skip to content

fix(cli): generated module pages read their locale file (#918) - #926

Merged
antosubash merged 5 commits into
mainfrom
fix/issue-918-keyed-module-pages
Nov 12, 2026
Merged

antosubash merged 5 commits into
mainfrom
fix/issue-918-keyed-module-pages

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • The i18n-keyed Browse, Create and Edit pages are now the base module templates. Before this, only the in-repo framework_repo overlay had them.
    • They use t(keys.<module>.…) and useApiErrorToast.
    • A module created with smpy create-module inside an app, and smpy new's sample hello module, now read their text from locales/en.json.
    • Pages with literal English stay only for --standalone module repos (_optional/standalone/), which have no host to generate keys.
  • keys is a static object, and the app's tsc does not check module pages. On a real scaffolded app, npm run build passed before gen-i18n with keys.hello undefined, so the pages would have crashed at runtime. Three places now run gen-i18n before the frontend build:
    • make build depends on gen-pages and gen-i18n, in both app Makefiles;
    • both app Dockerfiles, before npm run build;
    • smpy module verify.
  • Docs: the module README template, the first-module guide snippet (t(keys.orders…)), module-authoring, the scaffolding.py docstring, CLAUDE.md, the simple-module-creating skill and the CHANGELOG.

Closes #918

Verification

  • Local CI: make lint, make test-py (8484 passed), make test-js (909 passed) all green.
  • New tests check three things: every key the pages use exists in the generated en.json; the Dockerfiles and Makefiles run gen-i18n before the build; and smpy module verify runs its steps in order.
  • Reviewed by two Sonnet reviewers (correctness and maintainability, 2 passes) and Codex (no findings).
  • Verification report: https://claude.ai/artifact/Y8jW25wSMfSuE2mhaDTAtF · /ship report: https://claude.ai/artifact/FH3Gp5W8VL1bTppMdKMDW7

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

Test plan

  • smpy new demo --yes, make build: the hello pages render their en.json text
  • CI is green

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T16:37:04.930935Z 28205cd 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: 28205cd
Status: ✅  Deploy successful!
Preview URL: https://14fe02ad.simple-module-python.pages.dev
Branch Preview URL: https://fix-issue-918-keyed-module-p.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit 60a44e4 into main Nov 12, 2026
16 checks passed
@antosubash
antosubash deleted the fix/issue-918-keyed-module-pages branch November 12, 2026 16:39
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: create-module pages hardcode English while shipping locales/en.json

1 participant