Sample: Loading category descriptions in multiple languages

This sample demonstrates how to load English and French category descriptions in a single step operation, as well as a multiple step operation.


About this sample

In this sample demonstrates two ways to load multi-language category descriptions:

To view the category descriptions in French in the Madisons storefront, select the French option in the language list on the Madisons home page.

Note: For this sample to work, the store we are using must support multiple languages. The Madisons starter store supports multiple languages.


Procedure

To load the English and French descriptions in the one-step operation:

  1. (Developer) On a command line, go to the WCDE_installdir\bin directory.

  2. (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
    For information about entering and leaving containers, see Running utilities from the Utility server Docker container.

  3. Enter the following command:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/MultiLanguages/wc-dataload-one-step-lang.xml

    • (Developer) dataload ..\samples\DataLoad\Catalog\MultiLanguages\wc-dataload-one-step-lang.xml

To load the English and French descriptions in the two-step operation:

  1. (Developer) On a command line, go to the WCDE_installdir\bin directory.

  2. (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
    For information about entering and leaving containers, see Running utilities from the Utility server Docker container.

  3. Enter the following command:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/MultiLanguages/wc-dataload-two-steps-lang.xml

    • (Developer) dataload ..\samples\DataLoad\Catalog\MultiLanguages\wc-dataload-two-steps-lang.xml


Verifying results

The wc-dataload-one-steps-lang.xml file calls the wc-loader-catalog-group-two-langs.xml configuration file, which has mappings for both English and French descriptions. The wc-loader-catalog-group-two-langs.xml file loads categories and descriptions from the CatalogGroupWithTwoLanguageDescription.csv source file.

In the two-step operation, the wc-dataload-two-steps-lang.xml configuration file loads categories from the CatalogGroupWithFirstLanguageDescription.csv source file. This CSV file contains the English names, short descriptions, and long descriptions of the categories. The wc-dataload-two-steps-lang.xml file then calls the wc-loader-catalog-group-description.xml configuration file to load the French names, short descriptions, and long descriptions from the SecondLanguageDescription.csv source file. The loader uses the CatalogGroupDescriptionMediator mediator to create descriptions for existing categories. The French language ID is defined in the wc-dataload-two-step-lang.xml file as follows:

Note: We must specify the appropriate encoding to use for the languages we want to load. The character set is defined in the wc-loader-catalog-group-description.xml file as follows:

Verify that the categories and descriptions have been loaded by running the following SQL statements:

We can also verify that the multi-language data has been loaded by viewing it in the Management Center or in the storefront.


Cleaning up the data

To remove the data loaded in this sample from the database, run the CleanUp.sql file in the /samples/DataLoad/Catalog/MultipleLanguages directory.