import { i18n } from '@/lib/i18n';import { loader } from 'fumadocs-core/source';export const source = loader({ i18n, // other options});
并更新 Fumadocs UI 布局选项。
import { i18n } from '@/lib/i18n';import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';export function baseOptions(locale: string): BaseLayoutProps { return { i18n, // different props based on `locale` };}
import Link from 'next/link';import { useParams } from 'next/navigation';const { lang } = useParams();return <Link href={`/${lang}/another-page`}>This is a link</Link>;