---
applyTo: "src/sites/cultroll/**"
---

# CultRoll Locale Instructions

## Locale model

- CultRoll uses flat URLs. Do **not** introduce locale path prefixes like `/en/...` or `/ar/...`.
- Locale precedence is:
  1. `?locale=` query param as an explicit setter
  2. `cr-locale` cookie
  3. `Accept-Language`
  4. city fallback via `pickDisplayLocale()`

## Navigation rule

- The rendered page locale must stay in sync with the `cr-locale` cookie. `BaseLayout.astro` is responsible for that client-side sync.
- For auth and account flows, and for other hand-authored cross-page links where language drift is costly, use the shared helpers from `src/sites/cultroll/i18n/index.ts`:
  - `withLocaleParam(path, locale)`
  - `buildLocaleAwareLoginHref(nextPath, locale)`
- Do not hardcode `/account`, `/account/login?...`, or ad hoc locale query strings in CultRoll page templates when a locale-preserving helper should be used instead.

## Why this matters

- Some CultRoll flows depend on redirect chains, cookie hydration, and city-aware fallbacks. Locale-sensitive links must preserve the user’s current language explicitly so English pages do not fall back to Arabic or Kurdish during auth/account transitions.
