Step 1: Configuring bootstrap files
In this step of the tutorial, you will perform two tasks:
In order to create a multicultural store, first have the bootstrap files to support the new languages and currencies.
Update main bootstrap files and load
WebSphere Commerce comes with many languages ready to be used by a store. Each language is associated with a particular country. Fortunately for purposes of this example, the product is not readily available for Canadian languages or Canadian currency. This allows us to load a new set of Canadian languages and currencies from scratch. The first step will be to identify the wcs.bootstrap_base.xml file within the WCDE_installdir\schema\xml\ directory and include the newly introduced store languages. For this example, Canadian English and Canadian French will be added. This will be easy as there is already an entry in the file that can be re-used:
<language language_id="-1" localename="en_US" language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" />From this entry, the following attributes will need to be updated for each Canadian language:
- language_id=unique numeric value
- language=
- 'en' for English
- 'fr' for French
- country='CA' for representing Canada
- localename=language value + '_' + country value
- encoding=same as value for en_US
- mimecharset=same as value for en_US
The resulting language entries for Canada are as follows:
<language language_id="124" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
<language language_id="125" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />The following steps are required to update and re-load the main WebSphere Commerce bootstrap file:
- Open the WC_installdir\schema\xml\ directory, and locate the file wcs.bootstrap_base.xml
- Make a backup of this file and name the backup wcs.bootstrap_base.xml.original
- Open the file for editing, and search for the following element:
- <language language_id="-1" localename="en_US" language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" />
- After that line, create two new language element entries in order to allow separate bootstrap files to make references to language primary keys:
- <language language_id="124" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
- <language language_id="125" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
- Save this file
- Within the WC_installdir\schema\xml\ directory, locate the file wcs.dtd
- Make a backup of this file and call it wcs.dtd.original
- Open the wcs.dtd file and locate the reference to <!ENTITY en_US "-1">
- Create additional lines after that line to include new entries <!ENTITY en_CA "124"> and <!ENTITY fr_CA "125">
- Save this file
- Download and extract the zip file included in this tutorial, and locate the env.bat file.
- Open the fileenv.batin a text editor and update the file to represent your environment, specifically theWCSHOMEandToolKitHomeproperties
- Open a command prompt, browse to the directory where you extracted the included zip file.
- Run the script massload_main.bat
Create multi-language bootstrap files
Once the language entries are added to the file wcs.bootstrap_base.xml, two new files need to be referenced:
- wcs.bootstrap_multi_en_CA_base.xml
- wcs.bootstrap_multi_fr_CA_base.xml
These two files represent language-specific data for each locale. Each file can be easily created by reusing existing files provided by default. Let's start with making new copies of those files and setting appropriate data elements as follows:
- Within the WC_installdir\schema\xml\ directory, locate the file wcs.bootstrap_multi_en_US_base.xml
- Make a copy of this file and name the copy wcs.bootstrap_multi_en_CA_base.xml
- Open this file for editing and perform a search/replace function to replace all references of &en_US; to 124 (value used in language_id)
- Search for entries for the languageds element
- Find the following line in the file:
<languageds language_id="124" description="United States English" language_id_desc="-1" />- Create two languageds element entries after that line in order to allow the Canadian English language to translate other language data as follows:
<languageds language_id="124" description="Canadian English" language_id_desc="124" /> <languageds language_id="124" description="Canadian French" language_id_desc="125" />Note: The description value of this entry is used to show up in the starter store and WebSphere Commerce Accelerator tools when users select their language of choice.
- Now we need to create all other languageds element entries in order to allow other languages to have a translation for this locale. Instead of updating every single wcs.bootstrap_multi_<locale>_base.xml file, we instead provide an entry for each locale within the Canadian English locale file. Copy the following lines into the same file for the 124 Canadian English locale:
<languageds language_id="-1" description="Canadian English" language_id_desc="124" /> <languageds language_id="-2" description="Canadian English" language_id_desc="124" /> <languageds language_id="-3" description="Canadian English" language_id_desc="124" /> <languageds language_id="-4" description="Canadian English" language_id_desc="124" /> <languageds language_id="-5" description="Canadian English" language_id_desc="124" /> <languageds language_id="-6" description="Canadian English" language_id_desc="124" /> <languageds language_id="-7" description="Canadian English" language_id_desc="124" /> <languageds language_id="-8" description="Canadian English" language_id_desc="124" /> <languageds language_id="-9" description="Canadian English" language_id_desc="124" /> <languageds language_id="-10" description="Canadian English" language_id_desc="124" />- Save this file
- Make a copy from wcs.bootstrap_multi_en_US.xml and rename to wcs.bootstrap_multi_en_CA.xml
- Open this file for editing and perform a search/replace function to replace all references from en_US to en_CA (this change references the new locale multi base file)
- Save this file
- Within the WC_installdir\schema\xml\ directory, locate the file wcs.bootstrap_multi_fr_FR_base.xml
- Make a copy of this file and name the copy wcs.bootstrap_multi_fr_CA_base.xml
- Open this file for editing and perform a search/replace function to replace all references of &fr_FR; to 125 (value used in language_id)
- Search for the following line:
<languageds description="Anglais (Etats-Unis)" language_id="125" language_id_desc="-1"/>- Create two languageds element entries under that line in order to allow the Canadian English language to translate other language data as follows:
<languageds language_id="125" description="Canadian English" language_id_desc="124" /> <languageds language_id="125" description="Canadian French" language_id_desc="125" />Note: The description value of this entry is used to show up in the starter store and WebSphere Commerce Accelerator tools when users select their language of choice.
- Now we need to create all other languageds element entries in order to allow other languages to have a translation for this locale. Instead of updating every single wcs.bootstrap_multi_<locale>_base.xml file, we instead provide an entry for each locale within the Canadian French locale file. Enter the following lines into the same file for the 125 Canadian French locale:
<languageds language_id="-1" description="Canadian French" language_id_desc="125" /> <languageds language_id="-2" description="Canadian French" language_id_desc="125" /> <languageds language_id="-3" description="Canadian French" language_id_desc="125" /> <languageds language_id="-4" description="Canadian French" language_id_desc="125" /> <languageds language_id="-5" description="Canadian French" language_id_desc="125" /> <languageds language_id="-6" description="Canadian French" language_id_desc="125" /> <languageds language_id="-7" description="Canadian French" language_id_desc="125" /> <languageds language_id="-8" description="Canadian French" language_id_desc="125" /> <languageds language_id="-9" description="Canadian French" language_id_desc="125" /> <languageds language_id="-10" description="Canadian French" language_id_desc="125" />- Save this file.
- Make a copy from wcs.bootstrap_multi_fr_FR.xml and rename to wcs.bootstrap_multi_fr_CA.xml
- Open this file for editing and perform a search/replace function to replace all references of fr_FR to fr_CA (this change references the new locale multi base file)
- Save this file.
After successfully loading these two new language bootstrap files into the database, WebSphere Commerce can include related multi-cultural data into the system. To load the new language bootstrap files, follow these steps:
- Open a command prompt, browse to the directory where you extracted the included zip file.
- Run the script massload_en_CA.batandmassload_fr_CA.bat
You have now updated the main bootstrap to include your new languages, and created new language specific bootstrap files to support the new languages.
In the next step of the tutorial you will learn how to include the new languages in your WebSphere Commerce instance.
(C) Copyright IBM Corporation 1996, 2006. All Rights Reserved.