Adding a language or currency to a store archive

WebSphere Commence provides store and catalog archive files. By default the store and catalog archives (SAR) for all business models are packaged with full translation and data support for the 13 language (locales) into which WebSphere Commerce is translated. To add a language or currency to a store you must modify the corresponding store SAR file and the catalog SAR file.

About this task

Modifying the store SAR file

The store SAR file contains store assets that require modification to support globalization. The modifications include

  • Adding a language.
  • Adding a currency.
  • Adding the new locale-specific files.
  • Creating locale-specific properties files.

Procedure

  1. Add a language.
    1. Extract the SAR file that you want to work with from the following directory, to a temporary directory, WC_installdir\SAR-new:
      • AIXLinuxWC_installdir/starterstores
      • For IBM i OS operating system WC_userdir/starterstores
      • WindowsWC_installdir\starterstores
      • WebSphere Commerce DeveloperWCDE_installdir\starterstores
    2. Add the following line at the end of the WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data\ForeignKeys.dtd file:
      <!ENTITY your_locale "100">
      

      Where your_locale is the language that you want to add to the store.

    3. Copy the en_US directory from the following directory:
      • WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data
    4. Paste the copy into the same directory and rename to your_locale, where your_locale is the language that you want to add.
      For example, fr_CA.
    5. Open all the XML files under the your_locale directory for editing.
    6. Make the following changes to each file:
      1. Partially translate the long or short description field.
      2. Change every occurrence of en_US to your_locale.
      3. In the accesscontrol.xml file,
        1. Partially translate the displayname and description fields.
        2. Change every occurrence of language_id="&en_US;" to language_id="&your_locale;"
  2. Add a currency.

    To add a currency, follow the steps in Adding a new currency for a store archive to add your national currency to the WebSphere Commerce system if it is not one of the currencies supported by default.

    1. Open WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data\currency.xml file in a text editor.
    2. Add the following line after the last <curlist> tag:
      
      <curlist currstr="your_national_currency_code" storeent_id="@storeent_id_1" />
      
    3. Add the following line at the end of the file:
      
      <curconvert storeent_id="@storeent_id_1" fromcurr="USD"
      tocurr="
      your_national_currency_code" factor="<conversion
      factor>"
      multiplyordivide="M" bidirectional="Y" updatable="Y"
      curconvert_id="@curconvert_id_7" />
      

      Where the your_national_currency_code is the ISO 4217 alphabetic currency code.

  3. Add the new locale-specific files.

    Use these instructions only if you are modifying the existing store data. During publish, all the data assets that are identified with placeholders in the store-data-asset.xml file are consolidated into the store-data-asset.xml file, creating one large data file. A corresponding DTD file is also required. Do the following to add the new locale-specific files to the store-data-assets.xml and store-data-assets.dtd files:

    1. Open the WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data\store-data-assets.xml file in a text editor and add the following lines after &en_US_fulfillment.xml:
      
      &<
      your_locale>_store.xml;
      &<
      your_locale>_fulfillment.xml;
      &<
      your_locale>_catalog.xml;
      &<
      your_locale>_contract.xml;
      &<
      your_locale>_businesspolicy.xml;
      &<
      your_locale>_accesscontrol.xml;
      
    2. Open the WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data\store-data-assets.dtd file in a text editor and add the following lines at the end of the file:
      
      <!ENTITY 
      your_locale_fulfillment.xml SYSTEM
      "
      your_locale/fulfillment.xml">
      <!ENTITY 
      your_locale_store.xml SYSTEM
      "
      your_locale/store.xml">
      <!ENTITY 
      your_locale_catalog.xml SYSTEM
      "
      your_locale/catalog.xml">
      <!ENTITY 
      your_locale_offering.xml SYSTEM
      "
      your_locale/offering.xml">
      <!ENTITY 
      your_locale_businesspolicy.xml SYSTEM
      "
      your_locale/businesspolicy.xml">
      <!ENTITY 
      your_locale_contract.xml SYSTEM
      "
      your_locale/contract.xml">
      <!ENTITY 
      your_locale_accesscontrol.xml SYSTEM
      "
      your_locale/accesscontrol.xml">
      
  4. Create locale-specific properties files.

    Do the following to create locale-specific properties files:

    1. Copy the following files:
      1. From the WC_installdir\SAR-new\WEB-INF\classes\StoreAssetsDir directory, copy all the properties files that end with en_US and rename them to match your locale:
      2. From the WC_installdir\SAR-new\SAR-INF\properties directory, copy the publishNLS_en_US.properties file and rename it to match your locale.
      3. From the WC_installdir\SAR-new\SAR-INF\devtools\flow\ui directory, copy the config_en_US.properties file and rename it to match your locale.
    2. Translate all the necessary properties files that you copied in the previous step into your new locale.
    3. If your language does not use the ISO-8859-1 encoding, run the Native2ascii tool to convert the translated files into the ASCII representation of Unicode. This process makes the data that is contained within the property file platform independent.
      Note: The native2ascii tool is included in both the SUN Java2 SDK and IBM JDK. The JRE, which is the runtime environment only, does not include native2ascii.
      The native2ascii converter is in the following directory:
      • AIXLinuxWAS_installdir/java/bin
      • For IBM i OS operating systemQIBM/ProdData/Java400/jdk13/ibm/bin
      • WindowsWAS_installdir\java\bin

      For more information about the native2ascii converter, see native2ascii - Native-to-ASCII Converter.

      1. At the command line, run
        
        native2ascii -encoding Source_encoding Source_file
        Destination_file

        For example,

        
        native2ascii -encoding ISO-8859-6
        WC_installdir\SAR-new\WEB-INF\classes\StoreAssetsDir\AddressText_ar_EG.properties
        WC_installdir\SAR-new\AddressText_
        your_locale.properties.temp
        
      2. Delete the WC_installdir\SAR-new\WEB-INF\classes\StoreAssetsDir\AddressText_fr_CA.properties file.
      3. Copy the properties temporary file from WC_installdir\SAR-new\AddressTextyour_locale.properties.temp to WC_installdir\SAR-new\WEB-INF\classes\StoreAssetsDir\AddressText_your_locale.properties.

    Merge your changes back into the SAR file that you are working with and use the modified version when you publish the SAR file.

  5. Modify the catalog SAR file.

    The catalog SAR file contains catalog assets that require modification to support globalization. The modifications include

    • Adding a language
    • Adding the new locale-specific files
    • Creating locale-specific properties files
  6. Extract the SAR file that you want to work with from the following directory, to a temporary directory, WC_installdir\SAR-new:
    • AIXLinuxWC_installdir/starterstores
    • For IBM i OS operating system WC_userdir/starterstores
    • WindowsWC_installdir\starterstores
    • WebSphere Commerce DeveloperWCDE_installdir\starterstores
  7. Add a language to the catalog SAR file.
    1. Extract the SAR file that you want to work with from the following directory, to a temporary directory, WC_installdir\CAT-new:
      • AIXLinuxWC_installdir/starterstores/common/samplecatalogs
      • For IBM i OS operating system WC_userdir/starterstores/common/samplecatalogs
      • WindowsWC_installdir\starterstores\common\samplecatalogs
      • WebSphere Commerce DeveloperWCDE_installdir\starterstores\common\samplecatalogs
    2. Copy the en_US directory from the following directory:
      • WC_installdir\CAT-new\WEB-INF\stores\Sample\data
    3. Paste the copy into the same directory and rename to your_locale, where your_locale is the language that you want to add, such as fr_CA.
    4. Open all the XML files under the your_locale directory for editing.
    5. Make the following changes to each file:
      1. Partially translate the description, field1, and field2 fields.
      2. Change every occurrence of en_US to your_locale.
  8. Add the new locale-specific files

    Use these instructions in only if you are modifying the starter store data. During publish, all the data assets that are identified with placeholders in the store-data-asset.xml file are consolidated into the store-data-asset.xml file, creating one large data file. A corresponding DTD file is also required. Do the following to add the new locale-specific files to the store-data-assets.xml and store-data-assets.dtd files:

    1. Open the WC_installdir\CAT-new\WEB-INF\stores\Sample\data\store-data-assets.xml file in a text editor and add the following lines after &en_US_fulfillment.xml:
      
      &<
      your_locale>_catalog.xml;
      &<
      your_locale>_contract.xml;
      &<
      your_locale>_tax.xml;
      &<
      your_locale>_shipping.xml;
      
    2. Open the WC_installdir\CAT-new\WEB-INF\stores\Sample\data\store-data-assets.dtd file in a text editor add the following lines at the end of the file:
      
      <!ENTITY <
      your_locale>_shipping.xml SYSTEM "<
      your_locale>/shipping.xml">
      <!ENTITY <
      your_locale>_tax.xml SYSTEM "<
      your_locale>/tax.xml">
      <!ENTITY <
      your_locale>_catalog.xml SYSTEM "<
      your_locale>/catalog.xml">
      <!ENTITY <
      your_locale>_contract.xml SYSTEM "<
      your_locale>/contract.xml">
      
  9. Create locale-specific properties files.

    Do the following to create locale-specific properties files:

    1. Copy the following files:
      1. From the WC_installdir\CAT-new\SAR-INF\properties directory, copy the publishNLS_en_US.properties file and rename it to match your locale.
    2. Translate the properties file that you copied in the previous step into your new locale.
    3. If your language does not use the ISO-8859-1 encoding, run the Native2ascii tool to convert the translated files into the ASCII representation of Unicode. This process makes the data that is contained within the property file platform independent.
      Note: The native2ascii tool is included in both the SUN Java2 SDK and IBM JDK. The JRE, which is the runtime environment only, does not include native2ascii.
      The native2ascii converter is in the following directory:
      • AIXLinuxWAS_installdir/java/bin
      • For IBM i OS operating systemQIBM/ProdData/Java400/jdk13/ibm/bin
      • WindowsWAS_installdir\java\bin

      For more information about the native2ascii converter, see native2ascii - Native-to-ASCII Converter.

      1. At the command line, run
        
        native2ascii -encoding Source_encoding Source_file
        Destination_file

        For example,

        
        native2ascii -encoding ISO-8859-6
        WC_installdir\CAT-new\WEB-INF\classes\StoreAssetsDir\AddressText_ar_EG.properties
        WC_installdir\CAT-new\AddressText_
        your_locale.properties.temp
        
      2. Delete the WC_installdir\CAT-new\WEB-INF\classes\StoreAssetsDir\AddressText_fr_CA.properties file.
      3. Copy the properties temporary file from WC_installdir\CAT-new\AddressTextyour_locale.properties.temp to WC_installdir\CAT-new\WEB-INF\classes\StoreAssetsDir\AddressText_your_locale.properties.

    Merge your changes back into the SAR file that you are working with and use the modified version when you publish the SAR file.