Adding support for a language to an Aurora-based store with REST API

With the language added to HCL Commerce, you can now add the language to the list of supported languages for your asset stores and customer-facing store. You can then select to view your store in the new language. However, the text for your store will still display in the default language. You customize your storefront text to display in the new language in the next lesson.

Procedure

  1. Compose the REST API request to add the language to a specific store.
    To compose the API call you need the following details for identifying the store and language:
    • The store ID. This ID identifies the store where you are adding the support for the language.
    • The language ID. This ID must be a negative integer. This ID is used to identify the language locale within HCL Commerce.
    If you want to add the language to an extended sites store, you need to complete multiple POST calls. You need to first add the language to the asset stores for the extended sites store and then add the language to the extended site store itself. Add the language to these stores in the following sequence
    1. Storefront asset store
    2. (Optional) Catalog asset store. Add the language to the catalog asset store if you need to add catalog descriptions in the new language to be shared by multiple extended site stores.
    3. Extended sites store.
    When you are adding languages to a store you need to use the following Administrative REST API:
    The body of the call to add the language to the storefront and catalog asset stores and to an extended site store can resemble the following body structure:
    
    {
        "items": [
           {
    	  \"storeId\":{{storeAssetStroreId}},
             \"languageId\":\"{{langId}}\"
             \"currency\": null\
    	},
           {
    	  \"storeId\":{{catalogAssetStoreId}},
             \"languageId\":\"{{langId}}\"
             \"currency\": null\
    	},
           {
    	  \"storeId\":{{esiteStoreId}},
             \"languageId\":\"{{langId}}\"
             \"currency\": null\
           },
        ]
    }
    
  2. Run your REST API calls add the language to your store.
    To run your REST API calls, you can bundle your REST calls into a JSON collection with the API calls for adding the language to HCL Commerce to run all the calls in sequence. The following collection shows how to bundle the API calls for adding a language. The collection also includes the calls needed to build the index so you can view your changes in the storefront.
    To use this collection, you need to define the environment variables for the API. The API calls within the collection are structured with variables. The values that are used for the variables can be included within a separate JSON file. The following file includes sample values for defining the Dutch Netherlands language for the default Aurora storefront and catalog asset stores and an extended site store. Replace the sample values that are set within the file with the values for the stores and the language that you are adding to your environment. You can then use the collection and values files to run the API requests to add the language.
    Note: If you need to delete a language, you can use the same REST API.
  3. Verify that your language is added to HCL Commerce and your store.
    1. Open the Management Center Store Management tool.
    2. From the Explorer view click Stores.
    3. From the list of available stores, right-click your storefront asset store and click Open.
    4. Within the properties view, review the list of supported languages for the store.
      Your new language should display within this list.
    5. Repeat the previous steps to verify that the language is available for your catalog asset store and extended site store.