From db42fa29dd838ec55865ca98a1bba35674449e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Sat, 17 Feb 2024 09:48:27 +0100 Subject: [PATCH] BugFix: switching locale for home page did not work --- app/ui/SelectLanguage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/SelectLanguage.tsx b/app/ui/SelectLanguage.tsx index 43c1a86..478eeba 100644 --- a/app/ui/SelectLanguage.tsx +++ b/app/ui/SelectLanguage.tsx @@ -10,7 +10,7 @@ export const SelectLanguage: React.FC = () => { const currentLocale = useLocale(); const secondLocale = locales.find((l) => l !== currentLocale) as string; - const secondLocalePathname = defaultLocale === currentLocale ? `/${secondLocale}${currentPathname}` : currentPathname.replace(`/${currentLocale}/`, `/${secondLocale}/`); + const secondLocalePathname = defaultLocale === currentLocale ? `/${secondLocale}${currentPathname}` : currentPathname.replace(`/${currentLocale}`, `/${secondLocale}`); return ({localeNames[secondLocale]}); } \ No newline at end of file