Language pack installation steps: new implementation

About this task

These steps apply to a new implementation of the Sterling Configurator Visual Modeler. These steps assume that you completed the set-up steps, including:

  • Database configuration, privileges grants, and so on
  • Installation of the JAR file into your SDK
  • Creation of a project using the sdk newproject target
  • Installation of the appropriate database driver using the sdk installDB target, where DB is Oracle or Db2®.
Note: If you are using Windows Server Edition, 64-bit, or Windows 7, 64-bit, you might encounter the following issues when running SDK targets:
  • The system cannot resolve env.COMERGENT_SDK_HOME. To avoid this issue, explicitly specify the COMERGENT_SDK_HOME path in sdk.xml. For example: <property name="sdk.base.dir" value="C:/SDK"/>
  • You encounter a java.io.IOException: Cannot run program "command.com" error. You can ignore the exception, or upgrade to Ant 1.7 (or later).

To install the language pack, perform the following steps:

Procedure

  1. Install the language pack JAR file.

    This installs the language pack in the releases\debs-10.0 directory.

  2. Modify the web.xml file:
    1. From <sdk_home>, enter the following in a command window:
      
      ./sdk.sh customize web.xml (for UNIX)
      sdk customize web.xml (for Windows)
      
      
    2. Open <sdk_home>\projects\<project-name>\WEB-INF\web.xml in a text editor.
    3. Copy the section that begins with the following:
      
       <!-- Start of English US mapping -->
      And ends with the following:
      <!-- End of English US mapping -->
      
    4. Paste the entire section after the English US mapping section.
    5. Modify the new section's comments to refer to the locale name you are adding. For example:
      
      <!-- Start of French France mapping -->
      
    6. Modify the new section's file path references to refer to the locale name file path, such as /fr/FR. For example:
      
      <servlet-mapping>
            <servlet-name>DispatchServlet</servlet-name>
            <url-pattern>/fr/FR/catalog/*</url-pattern>
      </servlet-mapping>
      
  3. Configure the Internationalization.xml file.
    1. Enter the following in a command window:
      
      ./sdk.sh customize Internationalization.xml (for UNIX)
      sdk customize Internationalization.xml (for Windows)
      
      
    2. Open projects\<project-name>\templates\WEB-INF\properties\Internationalization.xml in a text editor.
    3. Add the locale designation to the Presentation element's supportedLocales field. For example, for the French France locale:

      <supportedLocales controlType="text" runtimeDisplayed="true" ChangeOnlyAtBootTime="true" visible="true" boxsize="60"
      displayQuestion="Presentation Locales"
      displayOptions="en_US,en_US (English-United States),
      zh_TW,zh_TW (Chinese-Taiwan),fr_FR,fr_FR
      (French-France),fr_BE,fr_BE (French-Belgium),
      de_DE,de_DE (German-Germany)" defaultChoice="en_US"
      help="Supported presentation locales.">en_US,fr_FR</supportedLocales>

    4. Add the following to the Languages element. Replace la with the language code and CO with the country or region code for your locale:
      
      <la visible="false">
      

      <defaultcountry or region controlType="text" runtimeDisplayed="true"
      ChangeOnlyAtBootTime="true" visible="false" boxsize="60"
      displayQuestion="URL for the Help Files" defaultChoice="US"
      help="This is the default country or region for a specific language">CO

      
      </defaultcountry or region>
      </la>
      For example, for the French France locale:
      <fr visible="false">
      

      <defaultcountry or region controlType="text" runtimeDisplayed="true"
      ChangeOnlyAtBootTime="true" visible="false" boxsize="60"
      displayQuestion="URL for the Help Files" defaultChoice="FR"
      help="This is the default country or region for a specific language">FR

      
      </defaultcountry or region>
      </fr>
      
    5. Add the locale table entry.

      The locale table entry includes the DB_SORT_LOCALE_NAME field, which specifies how to sort data that your users are viewing. Possible values are BINARY (sort by the binary value of the string data value) and LATIN_GENERAL_BIN (perform locale-specific sorting). Check with your Database Administrator to ensure that the sorting behavior that you select is supported for your database implementation.

      For Oracle-based implementations:

    6. Enter the following in a command window:

      For Oracle-based implementations:

      
      ./sdk.sh customize oracle_tables.sql (for UNIX)
      sdk customize oracle_tables.sql (for Windows)
      

      For Db2-based implementations:

      
      ./sdk.sh customize DB2_tables.sql (for UNIX)
      sdk customize DB2_tables.sql (for Windows)
      
    7. For Oracle-based implementations, open
      projects\<project-name>\WEB-INF\sql\Oracle\setup\oracle_tables.sql in a text editor.

      For Db2-based implementations, open
      projects\<project-name>\WEB-INF\sql\Db2\setup\DB2_tables.sql in a text editor.

    8. Search for the text "INSERT INTO CMGT_LOCALE"
    9. Add an INSERT statement for the locale you are installing after the INSERT INTO CMGT_LOCALE statement. The format is:
      INSERT INTO CMGT_LOCALE 
      (LOCALE_KEY,LOCALE_NAME,LOCALE_DESCRIPTION,
      ACTIVE_FLAG,DB_SORT_LOCALE_NAME )VALUES 
      ( key,'la_CO','country or region Language','Y','BINARY')
      /
      
    10. Key is the locale key. The locale key must be a unique numeric value.
    11. la_CO is the language code and country or region code. Use the appropriate language_country or region encoding for the locale you are installing, for example, fr_FR for French France, jp_JP for Japanese Japan, and so on.

      For example, the following INSERT statement is for supporting the fr_FR (French France) locale:

      INSERT INTO CMGT_LOCALE
      (LOCALE_KEY,LOCALE_NAME,LOCALE_DESCRIPTION,
      ACTIVE_FLAG,DB_SORT_LOCALE_NAME ) 
      VALUES ( 2,'fr_FR','France French','Y','BINARY')
      
      /
      
    12. Save and close the file.
  4. Add the country or region translations:
    1. Enter the following in a command window:
      
      ./sdk.sh customize LocaleNameDataList (for UNIX)
      sdk customize LocaleNameDataList (for Windows)
      
    2. Open projects\<project-name>\WEB-INF\xmldata\LocaleNameDataList in a text editor.
    3. The LocaleNameDataList file should contain only English and the language mappings for the locale(s) that you support. Remove all other Locale Mappings from the LocaleNameDataList file.
    4. At the end of the LocaleNameDataList clause, add lines to supply translations for the United States and the country or region for which you are installing a locale. For example, to provide French translations for the United States and France:

      <LocaleNameData state="INSERTED">

      
            <DisplayName state="INSERTED">France</DisplayName>
            <EffectiveLocale state="INSERTED">en_US</EffectiveLocale>
            <LocaleName state="INSERTED">fr_FR</LocaleName>
          </LocaleNameData>
          <LocaleNameData state="INSERTED">
            <DisplayName state="INSERTED">La France</DisplayName>
            <EffectiveLocale state="INSERTED">fr_FR</EffectiveLocale>
            <LocaleName state="INSERTED">fr_FR</LocaleName>
          </LocaleNameData>
          <LocaleNameData state="INSERTED">
            <DisplayName state="INSERTED">Les Etats-Unis</DisplayName>
            <EffectiveLocale state="INSERTED">fr_FR</EffectiveLocale>
            <LocaleName state="INSERTED">en_US</LocaleName>
          </LocaleNameData>
      

      If your implementation supports other locales, follow the same pattern so that each supported locale has translations for each country or region name.

  5. Add loading of the LightWeightLookupList to the minimal data load.
    1. Enter the following in a command window:
      
      ./sdk.sh customize LightWeightLookupList.lst (for UNIX)
      sdk customize LightWeightLookupList.lst (for Windows)
      
    2. Open projects\<project-name>\WEB-INF\scripts\LightWeightLookupList.lst in a text editor.
    3. Add a line specifying the language_country or region code:
      
      WEB-INF/xmldata/I18N/la_CO/LightWeightLookupList
      

      For example, to add French France:

      
      WEB-INF/xmldata/I18N/fr_FR/LightWeightLookupList
      
    4. Save and close LightWeightLookupList.lst.
  6. Configure the SearchConfigurationProperties.xml file.
    1. Enter the following in a command window:
      
      ./sdk.sh customize SearchConfigurationProperties.xml (for UNIX)
      sdk customize SearchConfigurationProperties.xml (for Windows)
      
      
    2. Open projects\<project-name>\WEB-INF\properties\ SearchConfigurationProperties.xml in a text editor.
    3. Add the following section to the <Locales> element. Replace la_CO with the appropriate language_country or region code for the locale you are installing, for example, fr_FR for French France.
      
      <Locale id="la_CO" queryParserClass="com.comergent.api.appservices
      .search.queryParser.standard.CmgtQueryParser">
      <Analyzers>
      
      <Analyzer analyzerClass=
      "com.comergent.api.appservices.search.analysis.
      CatalogSearchAnalyzer" description="CatalogAnalyzer" 
      id="search"/>
      
      <Analyzer analyzerClass="com.comergent.api.
      appservices.search.analysis.CatalogSearchAnalyzer"
       description="CatalogAnalyzer" id="build"/>
      
      
      </Analyzers>
      <DictionaryFile file="CatalogDictionary.mappings"/>
      </Locale>
      
    4. Save and close the file.
  7. Rebuild the project:
    
    ./sdk.sh merge -clean (for UNIX)
    sdk merge -clean (for Windows)
    
    
  8. Load the database with the new locale information:
    
    For UNIX:
    ./sdk.sh createDB
    ./sdk.sh loadDB or ./sdk.sh loadMatrixDB
    ./sdk.sh createSegDB (for Oracle only)
    ./sdk.sh loadSegDB or ./sdk.sh loadSegMatrixDB
    
    
    For Windows: 
    sdk createDB
    sdk loadDB or sdk loadMatrixDB
    sdk createSegDB (for Oracle only)
    sdk loadSegDB or sdk loadSegMatrixDB
    
    
  9. Build the deployable (.war file) image:
    
    ./sdk.sh distWar (for UNIX)
    sdk distWar (for Windows)
    
    
  10. Deploy the .war file to your servlet container.
  11. Navigate to the <sdk_home>\dist\timestamp-WAR directory, where timestamp has the form YYYYMMDD and is the date on which you issued the sdk distWar command. Rename the prefs_dev.xml file to prefs.xml, then copy it to the home directory of the user who is running the servlet container: user_home/cmgt/debs/conf/ directory.
  12. Restart your servlet container.
  13. Verify that the installation succeeded:
    1. Navigate to your implementation home page. The URL is similar to:
      
      http://<server>:<port>/Sterling/en/US/enterpriseMgr/matrix
      
    2. Log in as an administrator user, then click My Account.

      The User Detail page displays.

    3. The Preferred Locale drop-down list in the User Locale panel should include the locales that you just installed.
    4. Choose a locale from the drop-down list, click Save, log out, and log back in.

      The administrator user's home page should display with localized text. You can now create users who use the new locales.