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. As a result, to add a new 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 new language
  • Adding a new currency
  • Adding the new locale specific files
  • Creating locale specific properties files

Procedure

  1. Adding a new language
    1. Unzip the AdvancedB2BDirect SAR file from
      • SolarisLinuxAIXWC_installdir/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar
      • For IBM i OS operating system WC_userdir/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar
      • WindowsWC_installdir\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar
      • WebSphere Commerce DeveloperWCDE_installdir\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar

      to a temporary directory, WC_installdir\SAR-new.

    2. Add the following line at the end of the ForeignKeys.dtd file available in WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\
      <!ENTITY your_locale "100">
      

      Where your_locale is the language that you want to add.

    3. Copy the en_US directory from the following directory:
      • WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data\en_US

      to the following directory:

      • WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirectdata\ your_locale Where, your_locale is the language that you want to add. For example, fr_FR.
    4. From WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data\ your_locale open the following XML files in a text editor:
      • accesscontrol.xml
      • businesspolicy.xml
      • contract.xml
      • fulfillment.xml
      • store.xml
    5. Make the following change:
      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 en_US to your_locale.
  2. Adding a new currency

    To add a new currency follow the steps outlined 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 the currency.xml file in a text editor from WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data.
    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. Adding the new locale specific files

    Use the instructions in this section only if you are modifying the existing store data. During publish, all the data assets 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 store-data-assets.xml file in a text editor from WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data 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 store-data-assets.dtd file in a text editor from WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data and add the following lines at the end of the file:
      
      <!ENTITY <
      your_locale>_fulfillment.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/fulfillment.xml">
      <!ENTITY <
      your_locale>_store.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/store.xml">
      <!ENTITY <
      your_locale>_catalog.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/catalog.xml">
      <!ENTITY <
      your_locale>_offering.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/offering.xml">
      <!ENTITY <
      your_locale>_businesspolicy.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/businesspolicy.xml">
      <!ENTITY <
      your_locale>_contract.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/contract.xml">
      <!ENTITY <
      your_locale>_accesscontrol.xml SYSTEM
      "AdvancedB2BDirect/data/<
      your_locale>/accesscontrol.xml">
      
  4. Creating locale specific properties files

    Do the following to create locale specific properties files:

    1. Copy the following files:
      1. From WC_installdir\SAR-new\AdvancedB2BDirect\WEB-INF\classes\AdvancedB2BDirect copy the following English properties files and rename them to match your locale:
        • AddressText_locale.properties
        • Address_locale.properties
        • tooltechtext_locale.properties
        • UserRegistrationB2BText_locale.properties
        • UserRegistrationB2B_locale.properties
        • UserRegistrationText_locale.properties
        • UserRegistration_locale.properties
        • tooltechtext_dynamic_locale.properties
        • storeErrorMessages_locale.properties
        • OrgEntity_locale.properties
        • OrgEntityText_locale.properties
      2. From WC_installdir\SAR-new\SAR-INF\properties\ copy the publishNLS_locale.properties English properties files and rename it to match your locale.
      3. From WC_installdir\SAR-new\AdvancedB2BDirect\devtools\flow\ui\ copy the config_locale.properties English properties files and rename it to match your locale.
    2. Translate the following properties files that you copied in the previous step for your locale:
      • publishNLS_locale.properties
      • config_locale.properties
      • AddressText_locale.properties
      • tooltechtext_locale.properties
      • UserRegistrationB2BText_locale.propertiesperties
      • UserRegistrationText_locale.properties
    3. Run the Native2ascii tool to convert the translated files into the ASCII representation of Unicode. This is not required if your language uses the ISO-8859-1 encoding.
      1. At the command prompt, run
        
        native2ascii -encoding <Source_encoding> <Source_file>
        <Destination_file>:
        

        For example,

        
        native2ascii -encoding ISO-8859-6
        WC_installdir\SAR-new\AdvancedB2BDirect\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_ar_EG.properties
        WC_installdir\SAR-new\tooltechtext_
        locale.properties.temp
        
      2. Delete WC_installdir\SAR-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties
      3. Copy the properties temp file from WC_installdir\SAR-new\ tooltechtext_locale.properties.temp to WC_installdir\SAR-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties.

    Re-zip your changes into the AdvancedB2BDirect.sar file and use this modified version when publishing the .sar file.

  5. Modifying the catalog SAR file

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

    • Adding a new language
    • Adding the new locale specific files
    • Creating locale specific properties files
  6. To add a new language to the catalog SAR file:
    1. Unzip the AdvancedB2BDirect SAR file from the following directory:
      • SolarisLinuxAIXWC_installdir/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar
      • For IBM i OS operating system WC_userdir/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar
      • WindowsWC_installdir\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar
      • WebSphere Commerce DeveloperWCDE_installdir\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar

      to a temporary directory, WC_installdir\CAT-new.

    2. Copy the en_US directory from the following directory:
      • WC_installdir\CAT-new\WEB-INF\\stores\HardwareCatalog\data\en_US

      to the following directory:

      • WC_installdir\CAT-new\WEB-INF\stores\HardwareCatalog\data\ your_locale Where, your_locale is the language that you want to add.
    3. From WC_installdir\CAT-new\WEB-INF\stores\HardwareCatalog\data\ your_locale open the following XML files in a text editor:
      • catalog.xml
      • contract.xml
      • shipping.xml
      • tax.xml

      and do the following:

      1. Partially translate the (long or short) description field.
      2. Change every occurrence of en_US to your_locale.
      3. In the shipping.xml file do the following:
        1. Partially translate the description, field1, and field2 fields.
        2. Change every occurrence of en_US to your_locale
  7. Adding the new locale specific files

    Use the instructions in this section only if you are modifying the starter store data. During publish, all the data assets 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 store-data-assets.xml file in a text editor from WC_installdir\CAT-new\WEB-INF\stores\HardwareCatalog\data 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 store-data-assets.dtd file in a text editor from WC_installdir\CAT-new\WEB-INF\stores\HardwareCatalog\data and 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">
      
  8. Creating locale specific properties files

    Do the following to create locale specific properties files:

    1. From WC_installdir\CAT-new\SAR-INF\properties\ copy the publishNLS_locale.properties English properties files and rename it to match your locale.
    2. Translate the publishNLS_locale.properties properties files that you copied in the previous step for your locale.
    3. Run the Native2ascii tool to convert the files translated in the preceding step into the ASCII representation of Unicode. This is not required if your language uses the ISO-8859-1 encoding.
      1. At the command prompt, run
        
        native2ascii -encoding <Source_encoding> <Source_file>
        <Destination_file>:
        

        For example,

        
        native2ascii -encoding ISO-8859-6
        WC_installdir\CAT-new\AdvancedB2BDirect\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_ar_EG.properties
        WC_installdir\CAT-new\tooltechtext_
        locale.properties.temp
        
      2. Delete WC_installdir\CAT-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties
      3. Copy the properties temp file from WC_installdir\CAT-new\ tooltechtext_locale.properties.temp to WC_installdir\CAT-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties.

    Re-zip your changes into the HardwareCatalogData.sar file and use this modified version when publishing the .sar file.