Static internationalized (i18n) next.js website with the help of next-i18next and next-language-detector
This is a simple example of how to use next-i18next with Next.js for a complete static website and optional use of locize to get translations up and running quickly and easily.
You may have arrived here from the Next.js repository, from next-i18next repository or the react-i18next repository. Either way, for more documentation on:
- next-i18next, please visit the main README
- Next.js, please visit the website
- locize in combination with Next.js, please visit the main README
A step by step guide can be found in this tutorial.
optional locize usage (not mandatory)
Before "deploying" your app, you can run the downloadLocales script (or similar), which will use the cli to download the translations from locize into the appropriate folder next-i18next is looking in to (i.e. ./public/locales).
To prove that this works, pull this example to your local machine and run:
npm i
npm run build
npm run serve
and open your browser at http://localhost:8080
You can now deploy the out folder to any static webserver, like GitHub pages.