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
-
Add a language.
-
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.
- Open WC_installdir\SAR-new\WEB-INF\stores\StoreAssetsDir\data\currency.xml file in a text editor.
- 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.
-
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:
- 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;
- 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">
- 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
-
Create locale-specific properties files.
Do the following to create locale-specific properties files:
- Copy the following files:
- 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:
- From the WC_installdir\SAR-new\SAR-INF\properties directory, copy the publishNLS_en_US.properties file and rename it to match your locale.
- 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.
- Translate all the necessary properties files that you copied in the previous step into your new locale.
- 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:
- WAS_installdir/java/bin
- QIBM/ProdData/Java400/jdk13/ibm/bin
- WAS_installdir\java\bin
For more information about the native2ascii converter, see native2ascii - Native-to-ASCII Converter.
- 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
- Delete the WC_installdir\SAR-new\WEB-INF\classes\StoreAssetsDir\AddressText_fr_CA.properties file.
- 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.
- Copy the following files:
-
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
-
Extract the SAR file that you want to work with from the following directory, to a temporary
directory, WC_installdir\SAR-new:
- WC_installdir/starterstores
- WC_userdir/starterstores
- WC_installdir\starterstores
- WCDE_installdir\starterstores
-
Add a language to the catalog SAR file.
- Extract the SAR file that you want to work with from the following directory, to a temporary
directory, WC_installdir\CAT-new:
- WC_installdir/starterstores/common/samplecatalogs
- WC_userdir/starterstores/common/samplecatalogs
- WC_installdir\starterstores\common\samplecatalogs
- WCDE_installdir\starterstores\common\samplecatalogs
- Copy the en_US directory from the following directory:
- WC_installdir\CAT-new\WEB-INF\stores\Sample\data
- 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.
- Open all the XML files under the your_locale directory for editing.
- Make the following changes to each file:
- Partially translate the description, field1, and field2 fields.
- Change every occurrence of en_US to your_locale.
- Extract the SAR file that you want to work with from the following directory, to a temporary
directory, WC_installdir\CAT-new:
-
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:
- 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;
- 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">
- 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
-
Create locale-specific properties files.
Do the following to create locale-specific properties files:
- Copy the following files:
- From the WC_installdir\CAT-new\SAR-INF\properties directory, copy the publishNLS_en_US.properties file and rename it to match your locale.
- Translate the properties file that you copied in the previous step into your new locale.
- 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:
- WAS_installdir/java/bin
- QIBM/ProdData/Java400/jdk13/ibm/bin
- WAS_installdir\java\bin
For more information about the native2ascii converter, see native2ascii - Native-to-ASCII Converter.
- 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
- Delete the WC_installdir\CAT-new\WEB-INF\classes\StoreAssetsDir\AddressText_fr_CA.properties file.
- 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.
- Copy the following files: