03 — User Journey (i18n Module)
- 1. J1 — App cold start in a supported locale (student Ravi,
hi) - 2. J2 — Unsupported/absent locale (teacher with
fror no header) - 3. J3 — Missing key in a shipped catalog (drift)
- 4. J4 — Translation manager edits a key (planned)
- 5. J5 — New locale onboarding (planned)
- 6. Journey map
End-to-end journeys around locale resolution, catalog delivery and translation management. Motion/interaction conventions per 00-shared/08; QA baseline per 00-shared/10.
1. J1 — App cold start in a supported locale (student Ravi, hi)
- Ravi opens the app; device sends
Accept-Language: hi-IN, hi;q=0.9, en;q=0.8. I18nMiddlewaretakes the first tag, strips region and case:hi-IN→hi, whitelisted inSUPPORTED_LOCALES(i18n.middleware.ts:16-17,i18n.service.ts:11-21).- App calls
GET /api/v1/i18n/messages?locale=hi(JWT-authenticated,i18n.controller.ts:13-17); receives the fullhicatalog. - UI strings render in Hindi. Server-rendered messages (e.g. errors) use
I18nService.translate()with the same resolved locale. Success: consistent Hindi everywhere.
2. J2 — Unsupported/absent locale (teacher with fr or no header)
- Middleware leaves
ctx.localeunset (frnot in whitelist). getLocale()returns'en'(i18n.service.ts:27-30).GET /i18n/messagesreturns the English catalog (getMessages→DEFAULT_CATALOG,i18n.service.ts:47-49). Success: graceful English fallback, never an empty payload.
3. J3 — Missing key in a shipped catalog (drift)
- Developer adds
report.readytoen.jsonbut nothi.json. - A
hiuser triggers the message.translate('report.ready')finds nohientry → falls back toDEFAULT_CATALOG(i18n.service.ts:37-40). - User sees English inside an otherwise Hindi screen.
Today: silent. (planned): CI drift check
(
IMPLEMENTATION_PLAN.md:845) fails the build so this never ships.
4. J4 — Translation manager edits a key (planned)
- Aarav opens the (planned) translation console, filters locale
ta, statusmissing. - Edits the key in the per-locale editor (06_Screen_Specifications.md §2).
- Saves → validation checks placeholders match the
ensource (08_Form_Specifications.md §2) → updated catalog published. - Next app fetch (
GET /i18n/messages) returns the new string. (Publishing mechanics — file/DB, per-tenant or global — are (planned) and unresolved; see 00-shared/12.)
5. J5 — New locale onboarding (planned)
- Platform admin adds locale
knto the locale-management screen. - Catalog created empty → all keys show
missing. - Translators fill in; when a coverage threshold is met,
knis promoted toSUPPORTED_LOCALES— today this is a code+deploy change (i18n.service.ts:9-21is a code constant).
6. Journey map
| Step | Actor | System action | Outcome |
|---|---|---|---|
| Header sent | device | middleware whitelist check | locale or en |
| Fetch catalog | app | GET /i18n/messages?locale= | full catalog, fallback en |
| Render string | app/server | key lookup + {param} fill | localized text |
| Missing key | — | catalog → en → key | never-empty guarantee |
| Edit key (planned) | admin | console CRUD | next fetch serves it |