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