# Localization Implementation

## Source and parity

English is the authoring source. French and Arabic are independent production resources, not machine-generated runtime fallbacks. CI compares complete key shape, scalar types, required arrays, empty values, and route coverage. A missing translation blocks merge.

## Document state

Set document attributes on the server:

```html
<html lang="ar" dir="rtl" data-theme-preference="system" data-theme="dark"></html>
```

Do not wait for hydration to set language, direction, or resolved theme.

## Route behavior

- Public indexable pages use locale prefixes.
- Root `/` is the only route eligible for browser-language detection.
- Explicit locale URLs remain explicit.
- Switch by route ID, not string substitution.
- Preserve only allowlisted campaign parameters and valid section hashes.
- Canonicals are self-referential locale URLs.
- Every indexable locale page outputs reciprocal `en`, `fr`, `ar`, and `x-default` alternatives.

## Arabic and mixed direction

Use formal Modern Standard Arabic. Apply document-level RTL and CSS logical properties. Wrap plates, VINs, emails, phone numbers, URLs, currency codes, dates with Latin digits, model numbers, and analytics identifiers in `bdi dir="ltr"` or a typed isolation component. Do not add directional Unicode marks manually inside translation strings unless linguistic review documents the exception.

Icons mirror only when their meaning is directional. Product screenshots never mirror.

## Formatting

Language does not imply market. Formatters receive locale plus explicit currency, timezone, country, and numbering policy. The baseline uses Gregorian dates and Latin digits for all three language-only locales until market research approves another rule.

## Copy governance

Every visible string has a semantic key. Exceptions are the `homePageCar` proper name, immutable technical identifiers, and data supplied at runtime. Public evidence-bearing blocks include evidence status in their content model; pending or expired evidence suppresses the claim.
