From b488671bc3fda40891edc3e77a6f0038c0ffc738 Mon Sep 17 00:00:00 2001 From: Unchained Date: Tue, 24 Mar 2026 08:17:30 +0200 Subject: [PATCH] fix: language switcher always includes locale prefix in path --- src/components/layout/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 077fc2c..03b0352 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -51,7 +51,7 @@ export default function Header({ locale = "sr" }: HeaderProps) { } document.cookie = `NEXT_LOCALE=${newLocale}; path=/; max-age=31536000`; const pathWithoutLocale = pathname.replace(/^\/(sr|en|de|fr)/, "") || "/"; - const newPath = newLocale === "sr" ? pathWithoutLocale : `/${newLocale}${pathWithoutLocale}`; + const newPath = `/${newLocale}${pathWithoutLocale}`; router.push(newPath); setLangDropdownOpen(false); };