MOB-07 — Localisation & formatting
ARB files (fr now; ar and en scaffolded), RTL-safe layouts, DZD money and date formatting helpers.
| Field | Details |
|---|---|
| Task code | MOB-07 |
| Phase | P0 — Foundations (cadrage, UX/UI, architecture & contract) |
| Product scope | V1 |
| Status | Planned |
| Start | Tue 20 Oct 2026 |
| Due | Tue 20 Oct 2026 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 0.5 person-day(s) planned · 2 from scratch · size XS |
| Area · app | Mobile foundation · mobile |
| Depends on | MOB-01 |
| Unblocks | — |
| Milestones | — |
Summary
ARB files (fr now; ar and en scaffolded), RTL-safe layouts, DZD money and date formatting helpers.
Description
Both apps ship in French in V1 but Arabic (RTL) and English must be possible without refactoring (NFR-06), and every amount, date and phone must be formatted the same way everywhere. Scope: hoco_l10n with ARB files (fr template, ar and en scaffolded), generated localisations, enum labels taken from enums.json, client fallback messages per error code, and helpers for DZD centimes, Africa/Algiers dates and E.164 phones; plus the RTL-safe layout rules every feature follows. Translation of Arabic copy is out of scope. It needs the enum list from the spec (already in enums.json) and, later, final microcopy from Akram's screens. Every feature task uses these formatters and keys; MOB-17 verifies RTL readiness with them.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | hoco_l10n package with l10n.yaml, app_fr.arb as template, app_en.arb filled, app_ar.arb scaffolded with the same keys; flutter gen-l10n wired into melos gen | Imad |
| 2 | tool/gen_enum_labels.dart generating French labels and tones from content/spec/enums.json (e.g. OrderStatus.VALIDATED → « Validée », StockAvailability.OUT_OF_STOCK → « En rupture ») with an unknown-value fallback | Imad |
| 3 | Client fallback messages per error code (network « Pas de connexion internet », GPS_OUT_OF_TOLERANCE, ACCOUNT_PENDING_VALIDATION…) used when the server message is missing | Imad |
| 4 | Money helpers: formatDzd(centimes) → « 1 250,00 DA », compact KPI form, and parsing of typed amounts into integer centimes | Imad |
| 5 | Date helpers on the timezone package: formatDate/formatDateTime in Africa/Algiers, relative times (« il y a 5 min »), algiersBusinessDay(utc) for tours and objectives | Imad |
| 6 | Phone helpers: normalise 0555…, 555… and +213… to E.164 and display as « 0555 12 34 56 » | Imad |
| 7 | LocaleController provider (fr default; ar and en behind a debug/feature flag in V1) persisted locally and pushed to the API via Accept-Language | Imad |
| 8 | RTL rules: EdgeInsetsDirectional / AlignmentDirectional only, a custom lint or grep check in CI banning EdgeInsets.only(left/right) in feature code | Imad |
Deliverables
- packages/hoco_l10n/lib/l10n/app_fr.arb, app_en.arb, app_ar.arb
- packages/hoco_l10n/lib/src/format/money.dart, date.dart, phone.dart
- packages/hoco_l10n/tool/gen_enum_labels.dart and the generated enum_labels.g.dart
Acceptance criteria
- formatDzd(125000) renders « 1 250,00 DA » (narrow no-break space as thousands separator)
- 2026-11-03T23:30:00Z renders as 4 nov. 2026 at 00:30 and belongs to business day 2026-11-04 (Africa/Algiers)
- « 0555 12 34 56 » normalises to +213555123456
- Every value of every enum in enums.json has a French label; an unknown value shows a generic label without crashing
- Switching the locale to ar mirrors layouts (Directionality RTL) without overflow on the gallery screens (NFR-06)
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| NFR-06 | French in V1; Arabic (RTL) and English prepared from day one | V1 |
Test measures
- Unit tests for money, date (including the UTC → Algiers day boundary) and phone helpers
- CI check that all ARB files have the same keys and that enum labels match enums.json
- Golden of one sample screen in fr (LTR) and ar (RTL)
Risks
- Arabic copy will not exist in V1 — keep ar behind a flag and use pseudo-localisation to catch truncation early
KPI
- Delivered by Tue 20 Oct 2026 within 0.5 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
MOB-02 — Core package — HTTP client, interceptors, errors, storage, logging
hoco_core: flavor config, dio with auth/locale/app-version/Idempotency-Key interceptors, error-envelope mapping, secure storage, connectivity, Sentry.
MOB-04 — Flutter design system — tokens, theme, components
hoco_ui: Akram's tokens as ThemeData + ThemeExtensions, typography, the mobile component library and a widget gallery app for design QA.