'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { i18n } from '../../i18n-config' export default function LocaleSwitcher() { const pathName = usePathname() const redirectedPathName = (locale: string) => { if (!pathName) return '/' const segments = pathName.split('/') segments[1] = locale return segments.join('/') } return (
Locale switcher: