Internationalization
Support multiple languages in your documentation
Read the Next.js Docs to learn more about implementing I18n in Next.js.
Setup
-
Define all supported languages in a file.
i18n.ts -
Change your current source configurations.
source.ts -
Create the middleware that redirects users when missing locale.
middleware.ts -
Create a dynamic route
/app/[lang]
, and move all special files to the folder.app/[lang]/layout.tsx -
Write documents, see Page Conventions to learn how to organize your documents.
-
Configure i18n on your search solution. For Flexsearch, see Setup I18n.
Get Pages
To get the pages of a specific language, use the utilities exported from
source.ts
.
Static Generation
Generate parameters for every language and page.
Last updated on