From e1f0d4e54cb786d251d6277d0a01ae1d932053d9 Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Sun, 13 Aug 2023 23:10:46 +0200 Subject: [PATCH] Update locale-switcher.tsx --- components/ui/locale-switcher/locale-switcher.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ui/locale-switcher/locale-switcher.tsx b/components/ui/locale-switcher/locale-switcher.tsx index 542226d52..e9c826b83 100644 --- a/components/ui/locale-switcher/locale-switcher.tsx +++ b/components/ui/locale-switcher/locale-switcher.tsx @@ -28,7 +28,7 @@ export default function LocaleSwitcher() { // const translations = localeData.translations; - const redirectedPathName = () => { + const redirectedPathName = (locale: string) => { if (!pathName) return '/'; // if (translations.length > 0) { @@ -43,7 +43,7 @@ export default function LocaleSwitcher() { // } // } - return `/`; + return `/${locale}`; }; const [isOpen, setIsOpen] = useState(false); @@ -67,7 +67,7 @@ export default function LocaleSwitcher() { className={`flex w-full cursor-pointer items-center px-4 py-2 text-sm ${ currentLocale == locale.id && 'font-bold' }`} - href={redirectedPathName()} + href={redirectedPathName(locale.id)} > {locale.title}