next-i18next is a plugin that allows you to get translations up and running quickly and easily, while fully supporting SSR, multiple namespaces with codesplitting.
superplate serves an optional
i18n plugin that sets translation feature using next-i18next.
The translations of custom text messsages will be stored in each language's own separate folder.
Example translation folder structure:
For each translation folder create a json file and define translations with key-value pairs.
If you want to add a new language file you should:
- Create a new translation file in
- Add a key for the language into otherLanguages array in
Make sure both folder and key names are same.
changeLanguage() method of
i18n to set current language and trigger the language change manually.
t() function can be used to fetch the translation.
You can specify key as a String. It resolves key-value pair from language json file in locales folder and returns value as a string.
All this work will be handled automatically by CLI, so you don’t need to do anything extra as long as you choose next-i18next as i18n plugin during the project creation phase.
Don't forget to wrap your app with i18n, if you prefer to add next-i18next plugin to existing project.