import Link from 'next/link'; import { Languages } from 'lucide-react'; import { i18n, locales } from '@/lib/i18n'; import { cn } from '@/lib/cn'; // Home-navbar language switcher. // // fumadocs' built-in popover switcher (`LanguageSelect`) has its item clicks // swallowed when it is nested inside HomeLayout's Radix `NavigationMenu` — the // dropdown opens but selecting a locale never fires `onChange`/`router.push`. // The docs sidebar isn't wrapped in a NavigationMenu, so the built-in one works // there and is kept. Here we use a native `
` toggle + real `` // anchors, which navigate reliably inside the navbar (like the other nav links). // // The home navbar only renders on the landing page, so the targets are simply // each locale's home (`/`, `/fa`, `/ru`, `/zh`). export function HomeLanguageSwitcher({ current }: { current: string }) { return (

Choose a language

{locales.map(({ locale, name }) => ( {name} ))}
); }