Language pack installation steps: existing implementation
About this task
These steps apply to an existing implementation of the Sterling Configurator Visual Modeler.
- 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).
LightWeightLookupList
,
needs updating in the below scenarios: - While installing the L10n pack for a new locale, the file
\WEB-INF\xmldata\I18N\I18N\localecode\LightWeightLookupList
, state should be set toINSERTED
.
- While updating any entries for an existing locale, the state should
be set to
MODIFIED
.
These steps assume that your implementation was installed using the SDK and that you have an existing release structure within which to work.
Before you begin, stop your servlet container instance.
To install the language pack, perform the following steps:
Procedure
- Install the language pack JAR file. For example:
./sdk.sh install SterlingSellingSuite-Locale-DEBS-9.0-de-DE.jar (for UNIX) sdk install SterlingSellingSuite-Locale-DEBS-9.0-de-DE.jar (for Windows)
This installs the language pack in the
releases\debs-9.0
directory. - Modify the
web.xml
file:- If you have not already customized your
project's
web.xml
file for other locales, enter the following in a command window:./sdk.sh customize web.xml (for UNIX) sdk customize web.xml (for Windows)
- Open
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 German Germany mapping -->
- Modify the new section's file path references
to refer to the locale name file path, such as /de/DE. For
example:
<servlet-mapping> <servlet-name>DispatchServlet</servlet-name> <url-pattern>/de/DE/catalog/*</url-pattern> </servlet-mapping>
- If you have not already customized your
project's
- Configure the
Internationalization.xml
file.- If you have not already customized your
project's
Internationalization.xml
file for other locales, 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 German Germany
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,de_DE</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 German Germany locale:
<de visible="false">
<defaultcountry or region controlType="text" runtimeDisplayed="true"
ChangeOnlyAtBootTime="true" visible="false" boxsize="60"
displayQuestion="URL for the Help Files" defaultChoice="DE"
help="This is the default country or region for a specific language">DE</defaultcountry or region> </de>
- If you have not already customized your
project's
- Modify the
I18NLookup.lst
file:- Enter the following in a command window:
./sdk.sh customize I18NLookup.lst (for UNIX) sdk customize I18NLookup.lst (for Windows)
- Open
projects\<project-name>\WEB-INF\xmldata\I18N\I18NLookup.lst
in a text editor. - Add a line specifying the
LightWeightLookupList
file to load for the locale you are adding:WEB-INF/xmldata/I18N/la_CO/LightWeightLookupList
For example, to load the LightWeightLookupList file for German Germany:
WEB-INF/xmldata/I18N/de_DE/LightWeightLookupList
- Enter the following in a command window:
- Configure the
SearchConfigurationProperties.xml
file:- If you have not already customized your
SearchConfigurationProperties.xml
file for other locales, 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, de_DE
for German Germany.
<Locale id="de_DE" 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.
- If you have not already customized your
- Set the location of the XML loader script
and prefs.xml file:
- Enter the following in a command window:
sdk customize loadI18NFromXML.bat (For Windows systems) or: ./sdk.sh customize loadI18NFromXML.sh (For Unix systems)
- Open
\projects\project_name\WEB-INF\scripts\loadI18NFromXML.bat
or.sh
in a text editor. - Search for the line containing:
set LOADER_JAR=%DEBS_RELEASE_DIR%/image/install/lib/* (For Windows systems) LOADER_JAR=$DEBS_RELEASE_DIR/image/install/lib/* (For Unix systems)
- Set the LOADER_JAR variable to the full
pathname of your project's
image/install/lib/*
directory. In this step, the "*" is appended to the path to include all jars from theimage/install/lib
directory in the CLASSPATH. Ensure the directories are separated by forward slashes. For example:SET LOADER_JAR=C:/SDK351/releases/debs-9.0/image/install/lib/*
(Windows)
orLOADER_JAR=/debs/sdk351/releases/debs-9.0/image/install/lib/*
(Unix). - Specify the location of the
prefs.xml
preferences store file. Search for the line containing:-DDataServices.General.ServerId=1
- Add the following parameter to the JAVA_OPTS
parameter list:
-Dcomergent.preferences.store="prefs.xml_full_pathname"
Where prefs.xml_full_pathname is the location of the
prefs.xml
file in your project. For example, if your project name is matrix and your <sdk_home> is/debs/sdk351
, the command is as follows:$JAVA $JAVA_OPTS -DDataServices.General.ServerId=1 -Dcomergent.preferences.store="/debs/sdk351/projects/matrix/prefs.xml" -classpath $CP ${MAIN} dummy persist PARTNER_NAME=matrix $PHASE1_LIST MODE=QUIET
- 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:
- Use your SQL client tool to connect to
the existing knowlegebase. For connection information, consult the
values in the
projects\project_name\project_name-dev.properties
file. - Update the CMGT_LOCALE table entry. In
your SQL client tool, run the following SQL command:
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, de_DE for
German Germany, fr_FR for French France, jp_JP for Japanese Japan,
and so on.
For example, the following INSERT statement is for supporting the de_DE (German Germany) locale:
INSERT INTO CMGT_LOCALE (LOCALE_KEY,LOCALE_NAME,LOCALE_DESCRIPTION, ACTIVE_FLAG,DB_SORT_LOCALE_NAME ) VALUES ( 3,'de_DE','Germany German','Y','BINARY')
To check that your INSERT into the CMGT_LOCALE table is correct, run the following SQL statement:
select * from CMGT_LOCALE
- Use your SQL client tool to connect to
the existing knowlegebase. For connection information, consult the
values in the
- Add the country or region name translations:
- Update the CMGT_LOCALE_NAME Table. In
your SQL client tool, run the following SQL commands:
insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('la_CO', 'la_CO', 'Locale_country or region_Name', 'Y') insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('la_CO', 'defaultLA_defaultCO', 'default_country or region_Name', 'Y') insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('defaultLA_defaultCO', 'la_CO', 'country or region', 'Y')
Where:
- la_CO is the language_country or region combination for the locale you are adding, such as de_DE
- Locale_country or region_Name is the name of the country or region in the locale's language, such as Deutschland
- defaultLA_defaultCO is the language_country or region combination for the default locale, such as en_US
- default_country or region_Name is the name of the default country or region in the language of the locale that you are adding, such as Vereinigte Staaten
- country or region is the name of
the country or region in the default locale's language, such as Germany
For example, to add country or region name translations for German:
insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('de_DE', 'de_DE', 'Deutschland', 'Y') insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('de_DE', 'en_US', 'Vereinigte Staaten', 'Y') insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('en_US', 'de_DE', 'Germany', 'Y')
- If there are several locales installed
on your system, add a country or region name translation for the new
locale to each of the existing locales, and add a country or region
name translation for each existing locale to the new locale. For example,
if you already support the fr_FR locale and are adding support for
the de_DE locale, run the following SQL:
insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('fr_FR', 'de_DE', 'L''Allemagne', 'Y') insert into CMGT_LOCALE_NAMES (EFFECTIVE_LOCALE, LOCALE_NAME, DISPLAY_NAME, ACTIVE_FLAG) values ('de_DE', 'fr_FR', 'Frankreich', 'Y')
To check the results of the INSERT commands, run the following SQL command:
select * from CMGT_LOCALE_NAMES
- Update the CMGT_LOCALE_NAME Table. In
your SQL client tool, run the following SQL commands:
- In a command window, navigate to your
<sdk_home>\workspaces\<project-name>
directory and run the following command:WEB-INF\scripts\loadI18NFromXML.bat I18N jdbc_driver (for Windows Systems)
or
WEB-INF/scripts/loadI18NFromXML.sh I18N jdbc_driver (for Unix Systems)
where
jdbc_driver
is the full pathname of your JDBC jar file.For example:
WEB-INF\scripts\loadI18NFromXML.bat I18N oraclejdbc.jar
- In a command window, navigate to your
<sdk_home>
directory and 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
projects\project_name\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 displays with localized text. You can now create users who use the new locales.
- Navigate to your implementation home page.
The URL is similar to: