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 10 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:
- Add a new language
- Add a new currency
- Add the new locale specific files
- Create locale specific properties files
Adding a new language
To add a new language to the store SAR file:
- Unzip the AdvancedB2BDirect SAR file from
AIX|Linux|Solaris|WC_installdir/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar
I5/OS: WC_userdir/starterstores/AdvancedB2BDirect/AdvancedB2BDirect.sar
Windows:
WC_installdir\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar
WCDE_installdir\starterstores\AdvancedB2BDirect\AdvancedB2BDirect.sar
to a temporary directory, WC_installdir\SAR-new.
- 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 "-11">Where your_locale is the language that you want to add.
- 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.
- From WC_installdir\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
Make the following change:
- Partially translate the (long or short) description field.
- Change every occurrence of en_US to your_locale.
- In the accesscontrol.xml file:
- Partially translate the Displayname and description fields.
- Change every occurrence of en_US to your_locale.
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.
- Open the currency.xml file in a text editor from WC_installdir\SAR-new\WEB-INF\stores\BusinessDirect\data\AdvancedB2BDirect\data.
- Add the following line after the last <curlist ../> tag
<curlist currstr=" your_national_currency_code" storeent_id="@storeent_id_1" />- 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.
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:
- 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;- 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">
Creating locale specific properties files
Do the following to create locale specific properties files:
- Copy the following files:
- 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
- From WC_installdir\SAR-new\SAR-INF\properties\ copy the publishNLS_locale.properties English properties files and rename it to match your locale.
- From WC_installdir\SAR-new\AdvancedB2BDirect\devtools\flow\ui\ copy the config_locale.properties English properties files and rename it to match your locale.
- 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
- 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.
- 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- Delete WC_installdir\SAR-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties
- 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.
Modifying 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
To add a new language to the catalog SAR file:
- Unzip the AdvancedB2BDirect SAR file from the following directory:
AIX|Linux|Solaris|WC_installdir/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar
I5/OS: WC_userdir/starterstores/AdvancedB2BDirect/samplecatalogs/HardwareCatalogData.sar
Windows:
WC_installdir\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar
WCDE_installdir\starterstores\AdvancedB2BDirect\samplecatalogs/HardwareCatalogData.sar
to a temporary directory, WC_installdir\CAT-new.
- 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.
- 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:
- Partially translate the (long or short) description field.
- Change every occurrence of en_US to your_locale.
- In the shipping.xml file do the following:
- Partially translate the description, field1, and field2 fields.
- Change every occurrence of en_US to your_locale
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:
- 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;- 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">
Creating locale specific properties files
Do the following to create locale specific properties files:
- From WC_installdir\CAT-new\SAR-INF\properties\ copy the publishNLS_locale.properties English properties files and rename it to match your locale.
- Translate the publishNLS_locale.properties properties files that you copied in the previous step for your locale.
- 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.
- 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- Delete WC_installdir\CAT-new\WEB-INF\classes\AdvancedB2BDirect\tooltechtext_fr_FR.properties
- 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.
Related concepts
Supporting globalization
Localized store assets
Cultural considerationsRelated tasks
Create a globalized store
Add a new currency to WebSphere Commerce
Currency and number formattingRelated reference
Globalization tips
massload utility (Server environment)