i18n Phase 2 — DB locale column + /api/me/locale preference
Seen in 1 project by 1 person
About
Split from the master i18n plan (task i18n-en, Plane YOPSYS-62) for independent overnight dispatch.
BLOCKED ON: i18n foundation (Phase 1, task i18n-en) — imports SUPPORTED_LOCALES/Locale from @pickism/shared. This task is backlog so the dispatcher skips it; promote backlog → todo once the foundation has merged.
Scope (self-contained once unblocked, ~1–1.5h):
- Migration:
ALTER TABLE profiles ADD COLUMN locale text NOT NULL DEFAULT 'en' CHECK (locale IN ('en','fr')). Generate the CHECK list fromSUPPORTED_LOCALES. Backfill covered by DEFAULT. Heed the shared-dev-DB migration-timestamp-collision rule: pick a unique HHMMSS and check existing history first. - RLS unchanged — existing
profilespolicies already restrict updates toauth.uid() = id; add a test asserting it. PATCH /api/me/locale— validateslocale ∈ SUPPORTED_LOCALES, updates the row, sets theNEXT_LOCALEcookie in the response.- Tests:
/api/me/localeround-trip, RLS (user can only update own locale), CHECK rejects unknown codes.
Prod note: adds a column → migrations-first on prod before code that reads it ships (see prod-deploy procedure). Overnight worker targets local/staging; flag prod promotion as a follow-up.
Independent of Phases 3/4/5 — fully parallel with the app phases once the foundation lands.
Links
No links shared yet.
Listed in
Bookmarked in
Not in any public bookmark categories yet.