Set up complete internationalization (i18n) for a Fumadocs project following official best practices...
Automate the complete setup of internationalization (i18n) in a Fumadocs project with language routing, switcher UI, and proper content organization.
Use this skill when:
Before using this skill, verify:
fumadocs-core, fumadocs-ui, fumadocs-mdx)app/
βββ layout.tsx
βββ (home)/
βββ docs/
content/docs/
lib/
This skill will automatically:
Create i18n Configuration (lib/i18n.ts)
Set Up Middleware (middleware.ts)
Restructure App Directory
[lang] dynamic segmentConfigure Language Switcher
Organize Content by Language
content/docs/ with language directoriesUpdate All Configurations
source.ts for i18nlayout.shared.tsx to pass localeDefault configuration includes:
You can customize this list based on user requirements.
See the detailed README.md for step-by-step implementation guide.
β
Official fumadocs Approach - Follows fumadocs.dev documentation exactly
β
Language Switcher - Beautiful dropdown in navigation bar
β
Filtered Sidebar - Only shows content for current language
β
SEO-Friendly URLs - Clean /[lang]/docs structure
β
Automatic Detection - Middleware handles language routing
β
Type-Safe - Full TypeScript support
This skill addresses common fumadocs i18n pitfalls:
source.pageTree[lang]/[lang]/docs routingen/, zh/, etc. directoriesparser: 'dir' configurationThe skill will create or modify:
lib/i18n.ts β Newmiddleware.ts β Newapp/layout.tsx β Modifiedapp/[lang]/layout.tsx β Newapp/[lang]/(home)/layout.tsx β Movedapp/[lang]/docs/layout.tsx β Movedapp/[lang]/docs/[[...slug]]/page.tsx β Movedlib/source.ts β Modifiedlib/layout.shared.tsx β Modifiedcontent/docs/[lang]/ β New structureAfter running this skill, the user should have:
/en/docs, /zh/docs, /fr/docs, /ko/docs/ to default language