Full i18n stack for en/pt/es/fr/de, library-free, with catalog validation and two expansion passes
manueljpconde built a complete localization system for five languages without pulling in an i18n library. The implementation spans schema, backend allowlist, frontend runtime, catalog validation tooling, and two successive catalog expansion passes covering auth through main app surfaces.
The infrastructure PR adds a locale column on user_profiles with a named CHECK constraint (user_profiles_locale_check), a backend allowlist in locales.ts, and a matching frontend SupportedLocale type. PATCH /user/profile validates locale writes against the allowlist. All three layers must stay in sync - the commit notes this explicitly as a hazard to manage on any future locale additions.
Server-side resolution in the root layout walks mike_locale cookie → Accept-Language → en. Client-side switching goes through I18nContext without a full reload. ProfileLocaleSync is a render-only component that one-way pushes the stored profile locale to the cookie after authentication; the signup form was updated to persist the active locale so a pre-signup language switch isn't lost when the profile first loads.
A follow-up commit addressed four reviewer findings. The npm test scripts were passing quoted globs that tsx received literally on bash 3.2 - both backend and frontend now use a Node-based file discovery script (scripts/run-tests.mjs). findDuplicateTopLevelKeys.ts (95 lines, 95 tests) was added to the catalog validator after the review noted that JSON.parse silently deduplicates keys, which could let translation errors go undetected. The signup-flow locale persistence and document.documentElement.lang drift on client switches were also fixed.
A second PR expanded the catalog from the initial auth/sidebar coverage to the main app surfaces: account page, chat view, tabular reviews, assistant components, project modals, workflow list. That added roughly 104 keys per locale - 520 new translations in total. The translations were generated via Codex; the branch name makes that clear and native speaker review is recommended before customer-facing deployment.
Test counts after both patches: frontend 55/55, backend 34/34.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?