Next-generation platform

Modifying translation bundle entries for the application-defined components

You can either add a bundle entry or modify an existing bundle entry in the application-provided components or screens. You can override the existing bundle entries by adding the same keys along with the JSON path.
For example, you can add bundle entries, when you want to:
  • Modify the bundle entry of User ID and Password text input box widgets, and the Login button widget to My UserID.
  • Introduce a new text input box widget to enter Store ID in the Login page, which is a use case of adding new bundle entry.
To define a bundle entry or modify an existing bundle entry for your business, complete the following steps:
  1. Identify the feature for which you intend to add a bundle entry or modify the existing bundle entries in the <store-temp>/packages/features directory.
  2. Create the <featureName>/i18n folder structure in the <store-temp>/extensions/override-static-assets directory.
  3. Copy the translation bundle JSON file from the <store-temp>/packages/features/<featureName>/src/apps/assets/<featureName>/i18n folder to <store-temp>/extensions/override-static-assets/<featureName>/i18n folder.

    For example, consider that you want to add a new bundle entry, or modify the existing bundle entries in the Login page component of the Login feature application. In this case, create the login/i18n folder structure in the <store-temp>/extensions/override-static-assets directory. Then, copy the en.json file from <store-temp>/packages/features/login/src/apps/assets/login/i18n to <store-temp>/extensions/override-static-assets/login/i18n folder. You can modify the en.json in the <store-temp>/extensions/override-static-assets/login/i18n folder to add, modify, or remove bundle entries as needed. You can override the existing bundle entries by adding the same keys along with the JSON path as illustrated in the following sample code snippet.

    {
    "login": {
    "LABEL_UserId": "My User ID",
    "LABEL_Password": "My Password",
    "ACTION_Login": "My Log in",
    "LABEL_StoreID": "My StoreID",
    }
    }
    Note: Ensure that the key:value pairs is in quotes.
  4. When you support a new language or a locale, create locale-specific translation bundle file in the <store-temp>/extensions/override-static-assets/<featureName>/i18n folder. Also, ensure that the file name adheres to <localeId>.json format.