- Entry point:
src/pages/[lang]/index.js - Every RC files under
<Page> - New FC "sections" gets added into
src/components/Sections
🔥🔥🔥 Major thanks to xairoo to setting the stage for the basis of this project Please go check out his white starter app for i18next static rendering here!
This package brings youreact-i18nextandi18nextto your static sites build with thenext exportfuture from Next.js.
- 🗲 Translation is already rendered (SSG), client will receive the final translated site.
- 🔥 Hot reload works also when you update your locale (translation) files.
- 🚀 Automatic browser language detection can be realized.
- 🍪 Cookie stores the client language.
This project is deployed on github pages.
This starter allows you to use the next export future from Next.js in combination with i18n to create a complete static site.
Clients will directly redirected from / to /[lang] based on the detected language.
Packages included:
- i18next
- i18next-browser-languagedetector
- tailwindcss
- twin.macro
- styled-components
- Custom 404 page with i18n support
Clone the repository and run npm ci (recommend) or npm install.
- Set the supported languages, default language, namespaces and default namespace in
/src/i18n/config.js - Locales are located in
/src/locales/- To prevent mess, you can split the
.jsontranslation file(s) into multiple namespaces
- To prevent mess, you can split the
Run npm run dev to start the development server on http://localhost:3000.
Visit http://localhost:3000 to view this starter.
npm run exportnpm run serve