LogoPDFuck
LogoPDFuck
Internationalization
2025/03/15

Internationalization

Support multiple languages in your documentation

Before you get started

Fumadocs is not a full-powered i18n library, it manages only its own components and utilities.

You can use other libraries like next-intl for the rest of your app. Read the Next.js Docs to learn more about implementing I18n in Next.js.

Manual Setup

Define the i18n configurations in a file, we will import it with

@/ilb/i18n
in this guide.

Pass it to the source loader.

import { i18n } from '@/lib/i18n'; import { loader } from 'fumadocs-core/source'; export const source = loader({ i18n, // other options });

And update Fumadocs UI layout options.

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` }; }

Middleware

Create a middleware that redirects users to appropriate locale.

{ "file": "../../examples/i18n/middleware.ts", "codeblock": { "lang": "ts", "meta": "title=\"middleware.ts\"" } }

See Middleware for customisable options.

Note that this is optional, you can also use your own middleware or the one provided by i18n libraries.

Routing

Create a

/app/[lang]
folder, and move all files (e.g.
page.tsx
,
layout.tsx
) from
/app
to the folder.

Wrap the root provider inside

I18nProvider
, and provide available languages & translations to it. Note that only English translations are provided by default.

import { RootProvider } from 'fumadocs-ui/provider'; import { I18nProvider, type Translations } from 'fumadocs-ui/i18n'; const cn: Partial<Translations> = { search: 'Translated Content', // other translations }; // available languages that will be displayed on UI // make sure `locale` is consistent with your i18n config const locales = [ { name: 'English', locale: 'en', }, { name: 'Chinese', locale: 'cn', }, ]; export default async function RootLayout({ params, children, }: { params: Promise<{ lang: string }>; children: React.ReactNode; }) { const lang = (await params).lang; return ( <html lang={lang}> <body> <I18nProvider locale={lang} locales={locales} translations={{ cn }[lang]} > <RootProvider>{children}</RootProvider> </I18nProvider> </body> </html> ); }

Pass Locale

Pass the locale to Fumadocs in your pages and layouts.

Search

Configure i18n on your search solution.

  • Built-in Search (Orama): For Supported Languages, no further changes are needed.

    Otherwise, additional config is required (e.g. Chinese & Japanese). See Special Languages.

  • Cloud Solutions (e.g. Algolia): They usually have official support for multilingual.

Writing Documents

Navigation

Fumadocs only handles navigation for its own layouts (e.g. sidebar). For other places, you can use the

useParams
hook to get the locale from url, and attend it to
href
.

import Link from 'next/link'; import { useParams } from 'next/navigation'; const { lang } = useParams(); return <Link href={`/${lang}/another-page`}>This is a link</Link>;

In addition, the

fumadocs-core/dynamic-link
component supports dynamic hrefs, you can use it to attend the locale prefix. It is useful for Markdown/MDX content.

import { DynamicLink } from 'fumadocs-core/dynamic-link'; <DynamicLink href="/[lang]/another-page">This is a link</DynamicLink>
모든 게시물

작성자

avatar for MkSaaS
MkSaaS

카테고리

  • Company
  • Product
Manual SetupMiddlewareRoutingPass LocaleSearchWriting DocumentsNavigation

더 많은 게시물

Search
CompanyNews

Search

Implement document search in your docs

avatar for MkSaaS
MkSaaS
2025/02/15
Markdown
CompanyNews

Markdown

How to write documents

avatar for Mkdirs
Mkdirs
2025/03/05
Themes
NewsProduct

Themes

Add Theme to Fumadocs UI

avatar for Mkdirs
Mkdirs
2025/01/15
LogoPDFuck

브라우저 기반 묣�료 PDF 도구 - 100% 프라이빗하고 안전

정리
  • PDF 병합
  • PDF 분할
  • PDF 회전
  • 페이지 재정렬
  • 페이지 추출
  • 페이지 삭제
  • PDF 역순
  • 페이지 복제
변환
  • PDF를 PNG로 변환 + 긴 이미지
  • PDF를 JPG로 변환 + 긴 이미지
  • PDF를 WebP로 변환 + 긴 이미지
  • PNG를 PDF로 변환
  • JPG를 PDF로 변환
  • WebP를 PDF로 변환
  • PDF를 텍스트로 변환
  • BMP를 PDF로 변환
  • GIF를 PDF로 변환
  • SVG를 PDF로 변환
  • PDF를 Word로 변환
  • PDF를 Excel로 변환
  • PDF를 PPTX로 변환
  • Word를 PDF로 변환
  • Excel를 PDF로 변환
  • PPTX를 PDF로 변환
편집
  • PDF 압축
  • 워터마크 추가
  • 페이지 번호 추가
  • 메타데이터 편집
  • PDF 자르기
  • PDF 평탄화
  • 머리글/바닥글
  • PDF 크기 조정
보안
  • PDF 서명
  • PDF 잠금 해제
  • PDF 보호
  • PDF 비교
  • PDF 편집
  • PDF OCR
  • PDF 살균
  • PDF 검증
© 2026 PDFuck All Rights Reserved.