fix(i18n): stop Farsi links bouncing to /en; locale-aware nav links

- routing: localeDetection:false — a non-prefixed URL always serves fa (default);
  English only via explicit /en/ prefix. Browser Accept-Language no longer
  redirects fa pages to /en on every click.
- AdminShell + DashboardSidebarNav: use next-intl Link + usePathname (from
  @/i18n/navigation) instead of plain next/link, so links preserve the current
  locale and active-state matches the prefix-stripped path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-03 23:31:53 +03:30
parent 1cd1e504d9
commit d955d951b5
3 changed files with 15 additions and 11 deletions
+6
View File
@@ -7,6 +7,12 @@ export const routing = defineRouting({
defaultLocale: "fa",
/** Default locale gets no /fa/ prefix; English is under /en/ */
localePrefix: "as-needed",
/**
* 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,
});
export type Locale = (typeof routing.locales)[number];