2026-05-24 17:37:21 +03:30
|
|
|
import { defineRouting } from "next-intl/routing";
|
|
|
|
|
|
|
|
|
|
export const routing = defineRouting({
|
|
|
|
|
/** All supported locales */
|
|
|
|
|
locales: ["fa", "en"] as const,
|
|
|
|
|
/** Default locale — no URL prefix */
|
|
|
|
|
defaultLocale: "fa",
|
|
|
|
|
/** Default locale gets no /fa/ prefix; English is under /en/ */
|
|
|
|
|
localePrefix: "as-needed",
|
2026-06-03 23:31:53 +03:30
|
|
|
/**
|
|
|
|
|
* Never auto-switch locale from the browser's Accept-Language. A non-prefixed
|
|
|
|
|
* URL always serves Farsi (the default); English is reached only via an
|
|
|
|
|
* explicit /en/ prefix — so clicking Farsi links no longer bounces to /en.
|
|
|
|
|
*/
|
|
|
|
|
localeDetection: false,
|
2026-05-24 17:37:21 +03:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type Locale = (typeof routing.locales)[number];
|