fix: vitrine/marketing pages use visitor's browser locale, not always English (v0.78.0)

getMarketingLocale() only ever read the marketing_locale cookie, defaulting anonymous first-time visitors to English until they manually used the language switcher — even though the switcher and a full French translation already existed. Now falls back to parsing Accept-Language when no cookie is set; an explicit switcher choice still wins on every later visit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-24 11:49:57 +02:00
parent 4aa47ca61d
commit 355ba944ad
6 changed files with 40 additions and 5 deletions
+2
View File
@@ -12,6 +12,8 @@ Status legend: **Exists** (fully working) · **Partial** (works but with a real
**Model Prefs gating (closed 2026-07-24):** `Settings → AI`'s Model Prefs section previously had zero gate — every user could pick a raw provider + model ID with no fencing. Now behind `isByokEnabled` (same gate as BYOK itself, since picking a specific provider/model only makes sense once you have your own key to route it to) — hidden entirely for non-BYOK users, not just locked-and-teased. `GET`/`PUT /api/v1/users/me/model-prefs` gated server-side via `requireByok()` too.
**Marketing/vitrine locale (closed 2026-07-24):** `getMarketingLocale()` (`apps/web/lib/marketing-locale.ts`) previously hard-defaulted anonymous visitors to English until they clicked the language switcher, even though the switcher's `marketing_locale` cookie mechanism and a fully French-translated marketing site both already existed. Now falls back to parsing the `Accept-Language` header (first supported tag in the browser's stated preference order) when no cookie is set; an explicit switcher choice still wins on every later visit, and logged-in visitors still get their saved `users.locale` first, unchanged.
| Feature | Status | Description | Key files |
|---|---|---|---|
| Recipe CRUD | Exists | Create/get/list/update/delete; update snapshots the prior version first (`recipeSnapshots`) | `apps/web/app/api/v1/recipes/**` |