Develop > Controller layer > Application developer > Support globalization > Globalized catalog content > Localized store assets


Add 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 modify the corresponding store SAR file and the catalog SAR file.

Modifying the store SAR file

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


Procedure

  1. Add a new language

    1. Unzip the AdvancedB2BDirect SAR file from

      • WC_INSTALL/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar

      • WC_USER/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar

      • WC_INSTALL\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar

      • WCDE_INSTALL\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar

      to a temporary directory, WC_INSTALL\SAR-new.

    2. Add the following line at the end of the ForeignKeys.dtd file available in WC_INSTALL\SAR-new\WEB-INF\stores\BusinessDirect\data\

      <!ENTITY your_locale "100">

      Where your_locale is the language that to add.

    3. Copy the en_US directory from the following directory:

      • WC_INSTALL\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data\en_US

      to the following directory:

    4. From WC_INSTALL\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data\ your_locale open the following XML files in a text editor:

      • accesscontrl.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. Add a new currency

    To add a new currency follow the steps outlined in Add a new currency for a store archive to add the 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_INSTALL\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. Add 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_INSTALL\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_INSTALL/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. Create locale specific properties files

    Do the following to create locale specific properties files:

    1. Copy the following files:

      1. From WC_INSTALL/SAR-new/AdvancedB2BDirect/WEB-INF/classes/AdvancedB2BDirect copy the following English properties files and rename them to match your locale:

      2. From WC_INSTALL/SAR-new/SAR-INF/properties/ copy the publishNLS_locale.properties English properties files and rename it to match the locale.

      3. From WC_INSTALL\SAR-new\AdvancedB2BDirect\devtools\flow\ui\ copy the config_locale.properties English properties files and rename it to match the locale.

    2. Translate the following properties files that you copied in the previous step for the locale:

    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_INSTALL\SAR-new\AdvancedB2BDirect\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_ar_EG.properties
        WC_INSTALL\SAR-new\tooltechtext_
        locale.properties.temp
        

      2. Delete WC_INSTALL\SAR-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties

      3. Copy the properties temp file from WC_INSTALL\SAR-new\ tooltechtext_locale.properties.temp to WC_INSTALL\SAR-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties.

    Re-zip the changes into the AdvancedB2BDirect.sar file and use this modified version when publishing 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:

    • Add a new language

    • Add the new locale specific files

    • Create 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:

      • WC_INSTALL/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar

      • WC_USER/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar

      • WC_INSTALL\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar

      • WCDE_INSTALL\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar

      to a temporary directory, WC_INSTALL\CAT-new.

    2. Copy the en_US directory from the following directory:

      • WC_INSTALL\CAT-new\WEB-INF\\stores\HardwareCatalog\data\en_US

      to the following directory:

    3. From WC_INSTALL\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. Add 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_INSTALL\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_INSTALL\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. Create locale specific properties files

    Do the following to create locale specific properties files:

    1. From WC_INSTALL\CAT-new\SAR-INF\properties\ copy the publishNLS_locale.properties English properties files and rename it to match the locale.

    2. Translate the publishNLS_locale.properties properties files that you copied in the previous step for the 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 the 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_INSTALL\CAT-new\AdvancedB2BDirect\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_ar_EG.properties
        WC_INSTALL\CAT-new\tooltechtext_
        locale.properties.temp
        

      2. Delete WC_INSTALL\CAT-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties

      3. Copy the properties temp file from WC_INSTALL\CAT-new\ tooltechtext_locale.properties.temp to WC_INSTALL\CAT-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties.

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


Related concepts

Support globalization

Localized store assets

Cultural considerations


Related tasks

Create a globalized store

Add a new currency to WebSphere Commerce

Currency and number formatting

Related reference

Globalization tips

massload utility (Server environment)


+

Search Tips   |   Advanced Search