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®.
- 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
- Install the language pack JAR file.
This installs the language pack in the
releases\debs-10.0
directory. - Modify the
web.xml
file:- From
<sdk_home>
, enter the following in a command window:./sdk.sh customize web.xml (for UNIX) sdk customize web.xml (for Windows)
- Open
<sdk_home>\projects\<project-name>\WEB-INF\web.xml
in a text editor. - Copy the section that begins with the
following:
<!-- Start of English US mapping --> And ends with the following: <!-- End of English US mapping -->
- Paste the entire section after the English US mapping section.
- Modify the new section's comments to refer
to the locale name you are adding. For example:
<!-- Start of French France mapping -->
- 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>
- From
- Configure the
Internationalization.xml
file.- Enter the following in a command window:
./sdk.sh customize Internationalization.xml (for UNIX) sdk customize Internationalization.xml (for Windows)
- Open
projects\<project-name>\templates\WEB-INF\properties\Internationalization.xml
in a text editor. - 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> - 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>
- 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:
- 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)
- 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. - Search for the text "INSERT INTO CMGT_LOCALE"
- 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') /
- Key is the locale key. The locale key must be a unique numeric value.
- 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')
/
- Save and close the file.
- Enter the following in a command window:
- Add the country or region translations:
- Enter the following in a command window:
./sdk.sh customize LocaleNameDataList (for UNIX) sdk customize LocaleNameDataList (for Windows)
- Open
projects\<project-name>\WEB-INF\xmldata\LocaleNameDataList
in a text editor. - The
LocaleNameDataList
file should contain only English and the language mappings for the locale(s) that you support. Remove all other Locale Mappings from theLocaleNameDataList
file. - 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.
- Enter the following in a command window:
- Add loading of the
LightWeightLookupList
to the minimal data load.- Enter the following in a command window:
./sdk.sh customize LightWeightLookupList.lst (for UNIX) sdk customize LightWeightLookupList.lst (for Windows)
- Open
projects\<project-name>\WEB-INF\scripts\LightWeightLookupList.lst
in a text editor. - 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
- Save and close
LightWeightLookupList.lst
.
- Enter the following in a command window:
- Configure the
SearchConfigurationProperties.xml
file.- Enter the following in a command window:
./sdk.sh customize SearchConfigurationProperties.xml (for UNIX) sdk customize SearchConfigurationProperties.xml (for Windows)
- Open
projects\<project-name>\WEB-INF\properties\ SearchConfigurationProperties.xml
in a text editor. - 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>
- Save and close the file.
- Enter the following in a command window:
- Rebuild the project:
./sdk.sh merge -clean (for UNIX) sdk merge -clean (for Windows)
- 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
- Build the deployable (.war file) image:
./sdk.sh distWar (for UNIX) sdk distWar (for Windows)
- Deploy the .war file to your servlet container.
- 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 theprefs_dev.xml
file toprefs.xml
, then copy it to the home directory of the user who is running the servlet container:user_home/cmgt/debs/conf/
directory. - Restart your servlet container.
- Verify that the installation succeeded:
- Navigate to your implementation home page.
The URL is similar to:
http://<server>:<port>/Sterling/en/US/enterpriseMgr/matrix
- Log in as an administrator user, then
click My Account.
The User Detail page displays.
- The Preferred Locale drop-down list in the User Locale panel should include the locales that you just installed.
- 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.
- Navigate to your implementation home page.
The URL is similar to: