diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 48b6b5e..a076765 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -48,12 +48,9 @@ export default function Header({ locale = "sr" }: HeaderProps) { setLangDropdownOpen(false); return; } - console.log("Switching from", locale, "to", newLocale); - console.log("Current pathname:", pathname); document.cookie = `NEXT_LOCALE=${newLocale}; path=/; max-age=31536000`; const pathWithoutLocale = pathname.replace(/^\/(sr|en|de|fr)/, "") || "/"; const newPath = `/${newLocale}${pathWithoutLocale}`; - console.log("Navigating to:", newPath); window.location.replace(newPath); setLangDropdownOpen(false); }; @@ -82,9 +79,9 @@ export default function Header({ locale = "sr" }: HeaderProps) { }, [mobileMenuOpen]); const navLinks = [ - { href: `${localePath}/products`, label: t("products") }, - { href: `${localePath}/about`, label: t("about") }, - { href: `${localePath}/contact`, label: t("contact") }, + { href: `/${locale}/products`, label: t("products") }, + { href: `/${locale}/about`, label: t("about") }, + { href: `/${locale}/contact`, label: t("contact") }, ]; return (