Tutorials > Management Center > Add a new locale for Management Center

< Previous | Next >


Configure and load bootstrap files

In this step of the tutorial you complete the following tasks:


Procedure

  1. Customize bootstrap file to include the new locale.

    The list of supported languages is defined in the LANGUAGE table. To support a new language, first add the language to this table.

    The wcs.bootstrap_base.xml file includes language entry elements for all locales available in WebSphere Commerce.

    Bootstrap files are XML files used to populate database tables with information, after the schema has been created.

    1. Locate...

      WCDE_INSTALL\schema\xml\wcs.bootstrap_base.xml

    2. Copy the wcs.bootstrap_base.xml file. Rename the copy wcs.mybootstrap.xml.

    3. Search the wcs.mybootstrap.xml file for the following code:

      <language language_ localename="en_US" 
      language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" /> 
      

      From this entry, the following attributes need to be defined for the new locale:

      language_id

      An identifier to uniquely identify the display format.

      localename

      A Java locale used to represent a political, geographical, or cultural region that has a distinct language and customs for formatting. The localename is the two-letter ISO 639 language code, followed by the two-letter ISO 3166 country code, separated by an underscore.

      language

      The name of the language.

      country

      The country or region for the language.

      encoding

      The character encoding value that the browser should use to display the page for this language. This should be the same encoding value used in the property files.

      mimecharset

      The character encoding used for MIME messaging. This value is usually different from that 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.

    4. Replace contents of wcs.mybootstrap.xml file with the new language element entry for the en_GB locale as shown below:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE import SYSTEM "wcs.dtd">
      <import>                                
      <language language_ localename="en_GB" language="en" country="GB" encoding="UTF-8" mimecharset="iso-8859-1" />
      </import> 
      

    5. Save this file.

    6. Copy the WCDE_INSTALL\schema\xml\wcs.dtd file. Rename the copy wcs_custom.dtd.

    7. In the wcs_custom.dtd file, search for <!ENTITY en_US "-1">

    8. Add an additional entry after <!ENTITY en_US "-1"> for the new locale.

      <!ENTITY en_GB "110">
      

      Each language used is assigned a unique identifier. In order for a locale name to be associated with a unique identifier, an entity is declared.

    9. Save this file.

    10. Import the wcs_custom.dtd file into the wcs.mybootstrap.xml file by replacing the wcs.dtd reference with wcs_custom.dtd. For example:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE import SYSTEM "wcs_custom.dtd">
      <import>                                
      <language language_ localename="en_GB" 
      language="en" country="GB" encoding="UTF-8" mimecharset="iso-8859-1" />
      </import> 
      

    11. Stop the WebSphere Commerce Test Server.

    12. Load the customized bootstrap file into the database:

      WCDE_INSTALL\bin\massload.bat WCDE_INSTALL\schema\xml\wcs.mybootstrap.xml
      

  2. Before you create multi-language bootstrap file for the new locale, manually insert some required database records that are missing from the related database table. See [Technote 1378025].

    To insert the records, run the following SQL statements:

    INSERT INTO POLICY(POLICY_ID,POLICYNAME,POLICYTYPE_ID,STOREENT_ID) VALUES(-2002,'DependentCreditSupport','ReturnPayment',-1);
    INSERT INTO POLICYCMD(POLICY_ID,BUSINESSCMDCLASS) VALUES(-2002,'com.ibm.commerce.returns.commands.RefundWithDependentSupportPolicyCmdImpl');
    INSERT INTO POLICYDESC(POLICY_ID,LANGUAGE_ID,DESCRIPTION,LONGDESCRIPTION) VALUES(-2002,-1,'Dependent Credit Support', 'Use Original Payment Methods with Dependent Credit Support');
    INSERT INTO TKLRREASON(TKLRREASON_ID,STORE_ID,SYSTEMDEFINED,CODE,TICKLEFREQUENCY,MARKFORDELETE) VALUES(-1011,0,1,'PaymentBatchError',0,0);
    INSERT INTO TKLRRSNDSC(TKLRREASON_ID,LANGUAGE_ID,DESCRIPTION) VALUES(-1011,-1,'Batch error');
    

  3. Create multi-language bootstrap file for United Kingdom English.

    1. Copy the WCDE_INSTALL\schema\xml\ wcs.bootstrap_multi_en_US_base.xml file. Rename the copy wcs.bootstrap_multi_en_GB_base.xml.

    2. In the wcs.bootstrap_multi_en_GB_base.xml file, replace all occurrences of &en_US with &en_GB.

    3. In the wcs.bootstrap_multi_en_GB_base.xml file, add a new language element entry. All translated data in WebSphere Commerce is associated with a language id. The multi-language bootstrap file must be updated to include all the entries associated with the new locale.

      • Search for <languageds language_ description="United States English" language_id_desc="-1" /> and add the following entry after the line for the en_GB description data:

        <languageds language_ description="United Kingdom English" language_id_desc="110" />   
        

    4. Create additional languageds element entries to allow other languages to have a translation for the en_GB locale. In the wcs.bootstrap_multi_en_GB_base.xml file, add the following lines:

      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      <languageds language_ description="United Kingdom English" language_id_desc="110" />
      

      Instead of updating every wcs.bootstrap_multi_localename_base.xml file, an entry for each locale will be included in the wcs.bootstrap_multi_en_GB_base.xml file. For example, If you were to use another locale other than en_GB, the contents of the wcs.bootstrap_multi_en_GB_base.xml file need to be translated to the corresponding language of the locale.

    5. Save and close the file.

    6. Copy the WCDE_INSTALL\schema\xml\ wcs.bootstrap_multi_en_US.xml file. Rename the copy wcs.bootstrap_multi_en_GB.xml.

    7. In the wcs.bootstrap_multi_en_GB.xml file, replace all occurrences of en_US with en_GB. This ensures that files created in the following steps are referenced in the wcs.bootstrap_multi_en_GB.xml file.

      The multi-language bootstrap file is the central point of data-load. It refers to several files that must be loaded into the database.

    8. Replace wcs.dtd with wcs_custom.dtd. For example:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE import SYSTEM "wcs_custom.dtd" [
      
      <!ENTITY bootbase SYSTEM "./wcs.bootstrap_multi_en_GB_base.xml">
      <!ENTITY bootmember SYSTEM "./wcs.bootstrap_multi_en_GB_member.xml">
      <!ENTITY boottickler SYSTEM "./wcs.bootstrap_multi_en_GB_tickler.xml">
      ENTITY bootorder SYSTEM "./wcs.bootstrap_multi_en_GB_order.xml">
      <!ENTITY bootcontract SYSTEM "./wcs.bootstrap_multi_en_GB_contract.xml">
      <!ENTITY bootruntime SYSTEM "./wcs.bootstrap_multi_en_GB_runtime.xml">
      <!ENTITY bootpromotion SYSTEM "./wcs.bootstrap_multi_en_GB_epromotion.xml">
      <!ENTITY bootreturn SYSTEM "./wcs.bootstrap_multi_en_GB_return.xml"> 
      ]>
      
      <import>
      &bootbase;
      &bootmember;
      &boottickler;
      &bootorder;
      &bootcontract;
      &bootruntime;
      &bootpromotion;
      &bootreturn;
      </import>
      

    9. Save and close the file.

    10. In the WCDE_INSTALL\schema\xml\ directory, locate the files starting with wcs.bootstrap_multi_en_US_*.xml (excluding wcs.bootstrap_multi_en_US_base.xml).

    11. Copy each wcs.bootstrap_multi_en_US_*.xml file. Rename to wcs.bootstrap_multi_en_GB_*.xml.

      For example, rename the copy of wcs.bootstrap_multi_en_US_contract.xml to wcs.bootstrap_multi_en_GB_contract.xml.

    12. In each of the wcs.bootstrap_multi_en_GB_*.xml. files, replace all occurrences of en_US with en_GB.

      For other locale customization, the multi-language bootstrap file should be translated to the corresponding language.

    13. Save and close all files.

    14. Stop the WebSphere Commerce Test Server.

    15. Load the multi-language bootstrap file into the database:

      WCDE_INSTALL\bin\massload.bat WCDE_INSTALL\schema\xml\wcs.bootstrap_multi_en_GB.xml
      

You have now customized a bootstrap file to include the en_GB locale and created new multi-language bootstrap files to support your new locale. In the next step, you include the en_GB locale in your WCS instance.

< Previous | Next >


+

Search Tips   |   Advanced Search