feat(THU-824): localize transactional email and let users pick a language - #1255
Merged
raivieiraadriano92 merged 9 commits intoSep 3, 2026
Conversation
Semgrep Security ScanNo security issues found. |
PR Metrics
Updated Wed, 02 Sep 2026 17:33:56 GMT · run #2890 |
|
Preview environment destroyed 🧹 Stack |
raivieiraadriano92
marked this pull request as ready for review
September 2, 2026 17:36
There was a problem hiding this comment.
🔭 thunder-deep-review (advisory)
Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: a8b21984dc53 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)
raivieiraadriano92
deleted the
raivieiraadriano92/thu-824-localize-transactional-email-from-userlocale
branch
September 3, 2026 18:09
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.
Localizes the four transactional emails (
magic-link,waitlist-joined,waitlist-not-ready,waitlist-reminder) and adds a language picker to the waitlist screen so users can choose before they ever have an account.Locale comes from
X-App-Language, not a persisted column. The ticket asked foruser.locale, but no such column exists and no async send path does either — every email goes out inside a request from the recipient's own client. Three of the four go to people with nouserrow at all, so a column would beNULLfor exactly those recipients. The header is already sent by every client, andshared/i18n/locales.tswas written in anticipation of the backend reading it.No Lingui macros on the backend. Bun has no Babel pass, so a macro import resolves to Lingui's stub and throws when called — and
shouldSkipEmail()hides that in dev and test, so it would surface first in production on the sign-in path. Backend copy uses the plaini18n._({ id })runtime instead, which extracts identically, and a lint rule bans the macro specifiers.Catalogs.
backend/lingui.config.tsowns a second, small.pocatalog compiled to committed.ts(Bun has no.poloader). Same gettext format and same locale set as the frontend, so translators see one pipeline. All 14 strings are translated in de/fr/es/pt-BR/ja.Testing
bun run test:backend·bun run test·bun run i18n:check. Emails were sent end-to-end through Resend in every locale.To see a localized email: send
X-App-Language: <tag>toPOST /v1/waitlist/join. Note the pseudo-locale is deliberately refused over the wire — it's reachable only viagetEmailI18n('en-XA')in the preview and tests.Notes for review
waitlist/routes.tssends Englishmessagetext that the client renders verbatim, so a German user can still get a German email and an English toast from one click. The clean fix is a frontend mapping forcode_already_sent, not localizing backend prose.