- Docs
- Specs
- Localization
- Arabic, English, RTL
Arabic, English, and RTL¶
TyteRide supports Arabic and English everywhere. This spec defines the localization contract for the API, Front Views, Fleet Dashboard, Passenger App, and Driver App.
1. Language Coverage¶
| Area | Rule |
|---|---|
| Supported languages | Arabic (ar) and English (en). |
| Default language | English (en) unless a user/client locale is explicitly known. |
| Scope | All surfaces and API-facing user messages/content that are part of product behavior. |
| Terminology | Domain terms remain consistent across languages; do not invent alternate product terms. |
2. API Localization¶
The API follows the localization conventions in API Conventions:
- Language selection:
Accept-Language: en|arselects response language; defaulten. - Message catalogs:
lang/enandlang/arhold localized messages. - Localized entity fields: Arabic entity fields are returned alongside English where defined, including
name_arand stoplabel_ar. - User locale:
users.localeis returned so clients can persist the choice. - Validation/errors: Validation messages and the
messagefield are localized. Error shape remains{ "message": string, "errors"?: Record<string, string[]> }.
flowchart LR
Client[Client surface] -->|Accept-Language: en/ar| API[API]
API --> Lang[lang/en or lang/ar messages]
API --> Fields[Localized entity fields e.g. name_ar/label_ar]
API --> UserLocale[users.locale in user/profile responses]
API --> Client
3. UI Direction and Maps¶
- RTL layout: Arabic uses RTL layout in Front Views, Fleet Dashboard, Passenger App, and Driver App.
- LTR layout: English uses LTR layout.
- Maps stay LTR: Map canvases/controls/rendering remain LTR even when the surrounding UI is RTL. Map labels/content may follow provider behavior, but layout/orientation of the map component must not flip.
- Bidirectional content: UI should handle mixed Arabic/English content safely (e.g., phone numbers, codes, IDs, route codes).
4. Client Localization Behavior¶
Build spec localization requirements:
- Dashboard and apps use
i18next+react-i18next. - Locale is persisted on the client.
- Language switch is available in settings.
- Front Views must also present Arabic and English; implementation details are not fully specified in the build spec.
| Surface | Expected behavior |
|---|---|
| Front Views | Arabic/English public content, RTL for Arabic, LTR maps if any. |
| Fleet Dashboard | i18next + react-i18next, persisted locale, settings switch, RTL/LTR layout. |
| Passenger App | i18next + react-i18next, persisted locale, settings switch, RTL/LTR layout. |
| Driver App | i18next + react-i18next, persisted locale, settings switch, RTL/LTR layout. |
5. Translation Workflow¶
The source docs define localization requirements but not a full translation-management workflow. The following minimum workflow is required by project conventions:
- Add keys/messages deliberately: New user-facing strings must have English and Arabic coverage before release.
- Keep keys stable: Avoid renaming keys without updating all consuming surfaces.
- Use domain terminology: Driver/Passenger/Manager/Company/Fleet Dashboard/Front Views/Platform Admin; never "coordinator" or "consumer".
- Review Arabic copy: Arabic translations should be reviewed for product/domain correctness; machine-only drafts are risky for operational terms.
- Document gaps: If a translation or locale-specific behavior is unknown, mark it as an open question rather than inventing copy.
6. Verification and Tests¶
Localization changes should be verified at the appropriate layer:
| Layer | Expected verification |
|---|---|
| API | Feature/contract tests for Accept-Language handling, localized message/validation errors, and localized entity fields where applicable. |
| Front Views | Visual/manual or automated checks for Arabic RTL and English LTR rendering; map LTR if maps appear. |
| Fleet Dashboard | Component/integration/e2e checks for locale switch, persisted locale, RTL layout, and LTR maps. |
| Passenger App | App-level checks for locale switch, persisted locale, RTL layout, and LTR maps. |
| Driver App | App-level checks for locale switch, persisted locale, RTL layout, and LTR maps. |
Minimum regression checks for any localized UI change:
- Arabic renders RTL without breaking navigation, tables, forms, or overlays.
- English renders LTR.
- Maps remain LTR in Arabic mode.
- Error messages remain readable and preserve the API error shape.
7. Open Questions¶
- Front Views i18n stack: Build spec names
i18nextfor Dashboard/apps; Front Views stack choice for runtime/content localization is not explicitly specified. - Locale source of truth: When
users.locale, device locale, and client-persisted locale differ, precedence is not fully specified. - Translation ownership: The process/tooling for managing translation files (manual files, TMS, review flow) is not defined.
- Localized notifications: Push/in-app notification localization workflow and fallback rules are not fully specified.
- Pluralization/formatting: Date/time/number pluralization and formatting rules per locale are not fully specified beyond RTL/LTR and language coverage.