HCL Commerce Version 9.1.14.0 or later

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:
  1. Navigate to the commerce-nextjs-store/integration/locales/core directory and copy the existing language folder.
  2. Go to the commerce-nextjs-store/integration/locales/custom directory and paste the copied folder.
  3. 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.

  4. Open the translation file located within the renamed folder.
  5. Modify the contents of the translation file to align with the language requirements you intend to add.
  6. 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.
  7. 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.

Results

In the Next.js store, your added language is visible in the list of languages.