Internationalization
Support multiple languages in your documentation
Introduction
Fumadocs core provides necessary middleware and options for i18n support.
You can define a config to share between utilities.
Source API
Change your current source configurations, loader will now generate multiple page trees for every locale.
See Source API.
Middleware
Redirects users to appropriate locale.
You can also customise the i18n middleware from i18n.ts
.
Hide Locale Prefix
To hide the locale prefix, for example, use /
instead of /en
, use the hideLocale
option.
Mode | Description |
---|---|
always | Always hide the prefix, detect locale from cookies |
default-locale | Only hide the default locale |
never | Never hide the prefix (default) |
It uses NextResponse.rewrite
to hide locale prefixes.
It's not recommended to use always
.
On this mode, locale is stored as a cookie, read and set on the middleware.
This may cause undesired cache problems on your hosting platform, and need to pay extra attention on SEO to ensure search engines can index your pages correctly.
Search
For Orama, see Setup I18n.
Last updated on