feat(i18n): add Spanish language support and per-instance active languages#1438
feat(i18n): add Spanish language support and per-instance active languages#1438thomasbeaudry wants to merge 1 commit into
Conversation
|
This PR should be last in the stack. Sorry... |
|
@gdevenyi You're right that last is mechanically possible — these three branches are independent, each cuts from 1. #1439 emits The mailer builds assignment URLs as: url: `${assignment.url}?lang=${language}` // apps/api/src/assignments/assignments.controller.tsEvery If the mailer lands first, that's a window where a participant gets a correctly-translated French email whose link opens the instrument in English, because the gateway drops the param. It's not a build break, so CI won't catch it — it's just quietly wrong for anyone who sends a remote assignment in that window. 2. Going last doesn't avoid the Spanish work, it relocates it into this PR. Declaring
#1440 is genuinely order-independent — it adds zero new I did rehearse the full merge in the order proposed: exactly one conflict ( |
|
Adding a third language (that none of us reads/writes) is a larger platform discussion than just the technicals. If there's a technical issue mixed in here (the assignment URLs) split it out. |
…uages
Declare `es` in the web app's LanguageOptions and add Spanish strings to every
`t({ ... })` call in the app — including the mail admin page, group email
templates, and assignment email form — plus the `es` keys in the translation
JSON files.
Because declaring `es` makes it a required key in every translation call, this
must land after the PRs that introduce new user-facing strings; it is the last
of the stack for that reason.
Adds an admin-configurable set of active languages so an instance can choose
which languages it offers; the language toggles in the sidebar, navbar, and
login page render only the active ones and hide entirely when a single language
is active.
The gateway resolves a `?lang` query param, so the assignment links emailed by
the mailer open in the participant's language.
Widening `Language` with `es` makes it broader than the instrument runtime's
`en | fr`, so the instrument translation call sites narrow explicitly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2344ca1 to
c922f00
Compare
|
Reordered as you asked — this is now last in the stack, and #1440 (UX, fully independent and the smallest) goes first. One consequence worth flagging: to go last, this PR had to be stacked on Two things improved by your ordering, for what it's worth: #1439 no longer needs a follow-up patch, and the The only thing that doesn't get fixed by reordering is the Rehearsed the full order (#1440 → #1439 → #1438): zero conflicts, and the assembled tree typechecks, lints, and passes 382 tests. |
|
This is not done properly. The agent does not understand how libui works. Here are the steps you need to do:
|
Splits #1434 into three PRs. This is PR 3 of 3 and merges last, per @gdevenyi's request.
Merge order
split/uxmainsplit/mailermainsplit/languagesplit/mailerWhy this one is stacked rather than independent
Declaring
esinLanguageOptionsmakesesa required key in everyt({ ... })call inapps/web— that's why this PR touches 82 files. Whichever PR lands after that declaration exists must supply Spanish for its own strings.Since this goes last, it carries the Spanish for the mailer's strings too: 117 of the lines here translate the mail admin page, group email templates, and assignment email form introduced in #1439. That's only possible if those files exist on this branch, hence the stack. The upside of this ordering is that #1439 needs no follow-up patch, and the
activeLanguages/ALL_LANGUAGESplumbing is no longer duplicated across two branches — it lives in #1439 and is simply inherited here.What's here
esdeclared inLanguageOptions, and Spanish added to everyt({ ... })call in the app, plus theeskeys inapps/web/src/translations/*.json. No new translation keys — the JSON changes are purelyesadditions.?langquery param, which is what makes the assignment links emailed by feat(mail): add outgoing email, group email templates, and assignment emails #1439 open in the participant's language.Languagewithesmakes it broader than the instrument runtime'sen | fr, so the instrument translation call sites narrow explicitly.Note on
admin/settings.tsxThe autosave refactor +
SaveStatuscomponent landed here rather than in the UX PR, because the new Languages card is built onautosave— separating them would have meant inventing a Save-button variant of the card that exists nowhere in #1434.Verification
tscandeslintclean forschemas,react-core,web,gateway,api;pnpm test382 passed / 1 skipped. Merging all three PRs in the order above was rehearsed end to end: zero conflicts, and the assembled tree typechecks, lints, and passes 382 tests. Two redundant type assertions (Navbar,Sidebar) were removed to satisfyno-unnecessary-type-assertion.🤖 Generated with Claude Code