Setting Up Multi-Language
You can set up multi-language support for your site. Translation can be set up for the following:
- Static labels or text (page titles, header, footer, tabs, descriptions) translations
- Schema or field label translations
- Data translation on the product catalog
Static Labels or text (Page Titles, Header, Footer, Tabs, Descriptions)
To translate static labels and text, you can use the local translation folder or add translation details on the Conga Platform.
The following table shows the effect of these translations' availability:
File on Local Translation Folder |
Translation details on the Conga Platform |
Description |
---|---|---|
Available |
Not Available |
The application checks the user's locale and translates static labels or text based on the local translation file. Refer to step 2 below. |
Not Available |
Available |
The application checks the user's locale and translates static labels or text based on the translations added to the Conga Platform. Refer to step 3 below. |
Available |
Available |
The application always merges with unique values, checks the user's locale, and appropriately translates static labels or text. |
Not Available |
Not Available |
The application considers English as a default language. |
Perform the following steps to add the translation details:
Step 1: Set the user-level locale
For translation, the application uses the user-level locale. You can set the user's locale using the following API: PATCH https://<URL_of_the_Instance>/api/user-management/v1/users/{userId}.
-
Sample request body to set the user's locale to the Spanish (es_ES) language.
{ "LocaleName": "es_ES" }
To list supported locales, use the following API:
GET https://<URL_of_the_Instance>/api/user-management/v1/locales
Step 2: Add local translation file(s)
The application first checks the local translation files (JSON files used to define translations) in this folder:
https://github.com/congarevenuecloud/partner-commerce/tree/release/february-23/src/assets/i18n
and then translates accordingly. The base template comes with some sample translation files under the assets/i18n
folder for your reference. You can clone any of the sample files and modify them to accommodate your preferred language.
Refer to the table below for the translation sequence.
Step 3: Add translation details on the Conga Platform
- Add a translation module using the Admin User Interface or the following API: POST
https://<URL_of_the_Instance>/api/localization/v1/translations/modules
- Update the
environment.ts
>translationModule
parameter with the module name added in the first step. - Add a translation value for the given locale and module using the Admin User Interface or the following API: POST
https://<URL_of_the_Instance>/api/localization/v1/translations/{locale}/{module}.
Tip:You must use the CustomLabels in the parameter as a Key and the stringified value of your translation JSON file as a Value.
For example:
{ "Key": "CustomLabels" "Value": "<stringified value>" }
Schema or Field Label
Define field label translation for the given object using the following API: POST
https://<URL_of_the_Instance>/api/schema/v1/objects/{objectName}/translations/{locale}.
You can also use other CRUD operations for Field Label translation using Object Definition Translation APIs.
Example 1:
To translate the field label Phone Number available on the Account object into the Spanish (es_ES) language:
Example 2:
To translate the field label Email and Shipping Address available on the Account object into the Italian (Switzerland) (it_CH) language:
Data Translation on Product Catalog
Data translation localizes such elements as product names, categories, and error messages from the Catalog API. Translation data is configured and verified across Product, Category, Attribute, AttributeGroup, Option, and OptionGroup modules within the product catalog. Use the following steps and APIs to translate data.
To set up data translation
Follow the below steps to set up data translation:
Step 1. Set the user-level locale
You can set the user-level locale via Admin User Interface using the "To edit a user" topic in the Conga Platform Admin Guide or the following "Update a user" API:
PATCH /api/user-management/v1/users/{userId}
To set the user-level locale via Admin UI, follow the steps below:
Example
Admin UI
To set the user's locale for Chinese language, follow the steps:
API
To set the user's locale for Chinese language "zh-Hans-MO", follow the steps below:
Step 2. Add translation values
You can add the translation values via Admin User Interface for the module using the "To add translation entries" topic in the Conga Platform Admin Guide or the following "Add translation value" API:
POST /api/localization/v1/translations/{locale}/{module}
To add translation entries via Admin UI, follow the steps below:
Examples:
Admin UI
To add Chinese values for product module, follow the steps below:
API
To add Chinese "zh-Hans-MO" values for product module, follow the steps below:
You can review the implemented changes for the product at the catalog level. For more information, see Browsing Catalog and Viewing the Product Details.