Configuring bootstrap files
In this lesson, you are configuring the bootstrap files that are required to support the new languages to your WebSphere Commerce instance. You must update the main bootstrap file and create the multi-language bootstrap files and load the files to add the language support.
In this step of the tutorial, you complete the following tasks: customize
bootstrap files to include a new locale; create multi-language bootstrap files. The list of
supported languages is defined in the LANGUAGE table. To support a new language, you must first add
the language to this table. The wcs.bootstrap_base.xml file includes language
entry elements for all locales available in WebSphere Commerce.
Note: Bootstrap files are XML
files that are used to populate database tables with information after the schema is
created.
About this task
WebSphere Commerce comes with many languages ready to be used by a store. Each
language is associated with a particular country. In this tutorial, you load Canadian languages and
the Canadian currency. First, locate the wcs.bootstrap_base.xml file within the
WCDE_installdir\schema\xml\ directory and include the new
store languages. You can reuse an entry in the
file:
<language language_id="&en_US;" localename="en_US" language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" />
Note: When
you specify the language_id value for your new language, use a negative
numerical value that starts at -1000. Do not use values from
-1 to -999 because these values are reserved for IBM use.
Update attributes for Canadian English and Canadian French languages.
- language_id
- An identifier to uniquely identify the display format.
- language
- The name of the language, where en represents English, and fr represents French.
- country
- The country or region for the language. CA represents Canada.
- localename
- A Java locale that is used to represent a political, geographical, or cultural region that has a distinct language and customs for formatting. The locale name is the two-letter ISO 639 language code, followed by the two-letter ISO 3166 country code, which is separated by an underscore. The language value and the country value separated by an underscore (_).
- encoding
- The encoding value that the browser uses to display the page for this language. The value is typically the same encoding value used in your property files (UTF-8).
- mimecharset
- The character encoding used for MIME messaging. This value is different from the value used by browsers. For example, the de-facto character encoding for MIME messaging in Japan is iso-2022-jp, while the most commonly used character encoding in all other applications is Shift_JIS. In this example, the following mimecharset is used.
The resulting language entries for Canada are
<language language_id="&en_CA;" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
<language language_id="&fr_CA;" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-15" />
The following steps are required to update and reload the main WebSphere Commerce bootstrap file:
Procedure
-
Create the bootstrap files for your new languages.
In these steps, for the variable
myLang
, use the locale name, for example,en_CA
andfr_CA
. -
Edit the wcs.dtd file:
-
Load the main bootstrap files:
-
Create multilanguage bootstrap files for Canadian English:
-
Create multilanguage bootstrap files for Canadian French:
-
Create the remaining multi-language bootstrap files for the Canadian English language.
-
Create the remaining multi-language bootstrap files for the Canadian French language.
-
Create the features bootstrap files for both new languages.
-
Load the multilanguage bootstrap files to add the language support to WebSphere Commerce:
- Open a command prompt, browse to the directory where you extracted the included compressed file.
- Run the script massload_en_CA.bat.
- Run the script massload_fr_CA.bat.
After you load the new language bootstrap files into the database, WebSphere Commerce can include related multicultural data into the system. - Similar to the previous step, load the features bootstrap files for both new languages, wcs.features_bootstrap_en_CA.xml and wcs.features_bootstrap_fr_CA.xml.
-
Index the new languages in WebSphere Commerce search, so that the search utilities,
storefront, and the Management Center can recognize them.
For more information about adding a language to WebSphere Commerce search, see Indexing a new language in WebSphere Commerce Search.