fix(koja): default to fa (no browser locale guess); guard null discoverProfile

Koja auto-detected locale from the browser Accept-Language (en for many Persian users); set localeDetection:false so locale-less URLs default to fa. Also guarded cafe.discoverProfile across the cafe page, cafe card, and JSON-LD — a café without a discover profile crashed the page (500). The cafe page now resolves the café first and notFound()s an unknown slug before fetching menu/reviews.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-02 01:51:50 +03:30
parent a83edf7667
commit e839db7331
4 changed files with 27 additions and 10 deletions
+3
View File
@@ -3,4 +3,7 @@ import { defineRouting } from "next-intl/routing";
export const routing = defineRouting({
locales: ["fa", "en"],
defaultLocale: "fa",
// Iran-first: don't pick the locale from the browser's Accept-Language
// (Persian users often have an en-US browser). Locale-less URLs default to fa.
localeDetection: false,
});