Setting Up Translations using SDK
The managed package consists of a Translator Loader. This Translator loader contains a folder named assets > i18n that consists JSON files used to define translations. By default, only the English language (en_US.json) is packaged with the base template. In order to add more languages, you can clone the English language JSON file and modify it to accommodate your preferred language. In the translator-loader.service.ts file, the translation GET method checks for the translation URL from the Storefront record. Priority is set to check if the Translation URL is defined on the Storefront object. If not, the system checks for the files in the SDK. The system selects the URL from the local JSON files. If both, the Storefront and the SDK, do not have the URL, the system sets the default language to English. Refer to the GET method code snippet. If the translation URL is not present on the Storefront object, the system uses SDK to translate labels, fields, and data.