Adding a language to Next.js store
You can add different languages in the Next.js store. A simple change to the configuration file will allow you to add a language.
Procedure
Perform the following steps to add a language:
- Navigate to the commerce-nextjs-store/integration/locales/core directory and copy the existing language folder.
- Go to the commerce-nextjs-store/integration/locales/custom directory and paste the copied folder.
-
Rename the copied folder with the name of the language you intend to add.
Note: Follow established naming conventions and guidelines when renaming a folder with the name of the language.
For example, fr_FR is used for French language.
- Open the translation file located within the renamed folder.
- Modify the contents of the translation file to align with the language requirements you intend to add.
-
Open the next.config.js file from the
commerce-nextjs-store directory and make the following
changes.
Enter the language name in the
locales
field. -
Run the
yarn integrate
command to integrate any changes or additions to the translation JSON files:Note: A warning message displays if details are missing in the locale or transaction file.