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:
- Identify the feature for which you intend to add a bundle entry or modify the existing bundle
entries in the
<store-temp>/packages/featuresdirectory. - Create the
<featureName>/i18nfolder structure in the<store-temp>/extensions/override-static-assetsdirectory. - Copy the translation bundle JSON file from the
<store-temp>/packages/features/<featureName>/src/apps/assets/<featureName>/i18nfolder to<store-temp>/extensions/override-static-assets/<featureName>/i18nfolder.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/i18nfolder structure in the<store-temp>/extensions/override-static-assetsdirectory. Then, copy theen.jsonfile from<store-temp>/packages/features/login/src/apps/assets/login/i18nto<store-temp>/extensions/override-static-assets/login/i18nfolder. You can modify theen.jsonin the<store-temp>/extensions/override-static-assets/login/i18nfolder 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 thekey:valuepairs is in quotes. - When you support a new language or a locale, create locale-specific translation bundle file in
the
<store-temp>/extensions/override-static-assets/<featureName>/i18nfolder. Also, ensure that the file name adheres to<localeId>.jsonformat.