From 35494d8b322b3af26dd1b5557e258142ec5b3136 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Mon, 1 Jun 2026 23:23:09 +0330 Subject: [PATCH] fix(i18n): keep locale on website->dashboard links; dashboard defaults to fa Marketing-site login/register/dashboard links were locale-less (app.meezi.ir/login), so the dashboard auto-detected locale from the browser Accept-Language (en-US) and redirected Persian users to /en. Links now carry the current locale, and the dashboard sets localeDetection:false so any locale-less entry defaults to fa (Iran-first) instead of guessing from the browser. Co-Authored-By: Claude Opus 4.8 --- web/dashboard/src/i18n/routing.ts | 5 +++++ web/website/src/app/[locale]/contact/page.tsx | 4 ++-- web/website/src/components/layout/navbar.tsx | 4 ++-- .../src/components/sections/launch-countdown-section.tsx | 2 +- web/website/src/components/sections/pricing-section.tsx | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web/dashboard/src/i18n/routing.ts b/web/dashboard/src/i18n/routing.ts index 0374920..d80a7e2 100644 --- a/web/dashboard/src/i18n/routing.ts +++ b/web/dashboard/src/i18n/routing.ts @@ -4,6 +4,11 @@ import { createNavigation } from "next-intl/navigation"; export const routing = defineRouting({ locales: ["fa", "ar", "en"], defaultLocale: "fa", + // Iran-first: don't auto-pick the locale from the browser's Accept-Language + // (Persian users often have an en-US browser). A locale-less URL defaults to + // fa; the locale is otherwise taken from the URL prefix or the marketing-site + // link (e.g. app.meezi.ir/fa/login). + localeDetection: false, }); export const { Link, redirect, usePathname, useRouter } = diff --git a/web/website/src/app/[locale]/contact/page.tsx b/web/website/src/app/[locale]/contact/page.tsx index 0ce386f..f445d97 100644 --- a/web/website/src/app/[locale]/contact/page.tsx +++ b/web/website/src/app/[locale]/contact/page.tsx @@ -41,7 +41,7 @@ const fa = { desc: "از داشبورد میزی در دسترس است", value: "چت زنده", cta: "ورود به داشبورد", - href: "https://app.meezi.ir", + href: "https://app.meezi.ir/fa", }, ], officeTitle: "دفتر مرکزی", @@ -79,7 +79,7 @@ const en = { desc: "Available inside the Meezi dashboard", value: "Live chat", cta: "Go to dashboard", - href: "https://app.meezi.ir", + href: "https://app.meezi.ir/en", }, ], officeTitle: "Head Office", diff --git a/web/website/src/components/layout/navbar.tsx b/web/website/src/components/layout/navbar.tsx index d404805..ee7ff5d 100644 --- a/web/website/src/components/layout/navbar.tsx +++ b/web/website/src/components/layout/navbar.tsx @@ -93,7 +93,7 @@ export function Navbar() { {locale === "fa" ? "EN" : "فا"} {t("login")} @@ -143,7 +143,7 @@ export function Navbar() {
{t("login")} diff --git a/web/website/src/components/sections/launch-countdown-section.tsx b/web/website/src/components/sections/launch-countdown-section.tsx index c1be437..091cf01 100644 --- a/web/website/src/components/sections/launch-countdown-section.tsx +++ b/web/website/src/components/sections/launch-countdown-section.tsx @@ -101,7 +101,7 @@ export function LaunchCountdownSection() {