Overview
There are three levels of localization with the Geoportal extension: localizing the Desktop Tools, localizing the interface, and localizing the lucene search engine. At 9.3.1, the interface is fully localizable, following the guidelines in this section. The lucene search is also localizable, as supported by Apache lucene contrib-analyzers API. The Desktop Tools are somewhat localizable, as follows:
Desktop Tools and Localization
Tool |
Interface localizable with source code |
CSW Clients |
Yes |
Geoportal extension Publishing Client |
Yes |
Geoportal extension WMC Client |
source code not distributable |
Harvesting Tool |
source code not distributable |
Geoportal Interface
The Geoportal extension 9.3.1 interface can be displayed in any language, including multi-byte and right-to-left languages. The language chosen for display is selected from the settings in a user's Internet browser and does not depend on any server-side variables. This means that a single instance of the Geoportal can be viewed by multiple users in multiple languages concurrently.
-
Language Codes
When offering localized interfaces, the localization will be identified by a specific language code. As a first step to localization, you must decide which languages the Geoportal should support. Once you have your language list set, look up the standard 2-letter internet language code for your chosen language(s). For example, French is referenced by "fr", German by "de" and Spanish by "es".
If you would like to localize for a particular flavour of a language, for example Canadian French, or Chilean Spanish, the internet language code will consist of 4 letters. The first two designate the language, and the latter two, the country. These two codes are then separated by a hyphen. For example Canadian French is fr-ca and Chilean Spanish is es-cl.
-
Setting Up Your Browser for Multiple Languages
Whether you are using Internet Explorer or Firefox, the language dialog behaves the same.
A list of all languages that have been previously selected for display are visible in the multi-select box. The languages are listed in order of preference, so that a language that is higher on the list will be displayed before a language that is lower on the list. The Geoportal will attempt to display its interface in the top-listed language. If the top-listed language is not available, the Geoportal will default to English.
Firefox 3
- Select Tools -> Options
- Click the "Content" icon
- From the "Languages" section of the dialog, click the "Choose..." button to bring up the Languages dialog.
Internet Explorer
- Select Tools -> Internet Options
- Select the "General" tab
- Click the "Languages" button at the bottom to bring up the Language Preferences dialog.
-
Enable Additional Languages in the Geoportal
In order for a language to be recognized by the Geoportal, you must include a reference to the added language in the gpt-faces-config.xml file.
- Decide which languages to offer and look up the necessary codes as described in the section above.
- Navigate to the \\geoportal\WEB-INF directory.
- Open the gpt-faces-config.xml in a text editor.
- Scroll down to the bottom of the file and locate the <application>\<locale-config> tags.
- For each language that will be supported in the Geoportal interface, an additional <supported-locale> tag should be added. The value of the tag will be the internet code of the language added. Example: <supported-locale>es</supported-locale> for Spanish support.
- Save the file and exit.
-
Localize the Interface
By default, strings displayed in the interface are referenced from the gpt.properties file found in \\geoportal\WEB-INF\classes\gpt\resources. To permanently localize the file to another language, translate the strings in the gpt.properties file directly and save the file overwriting the original. The default file will now render the interface in the new language.
To offer the Geoportal interface in multiple languages, do the following:
- Decide which languages to offer and look up the necessary codes as described in the section above.
- Copy the gpt.properties file to a new file, saving it with a filename that has an underscore and the language code appended after "gpt". For example, for a French file, the filename would be gpt_fr.properties. For a Chilean Spanish file, the filename would be gpt_es-cl.properties.
- Open the newly created properties file(s) in a text editor and translate into its respective language.
- Save the file(s) and exit.
- If the language being translated uses non-Latin1 characters, the native2ascii utility can be used to properly encode your newly created file.
- Restart the geoportal web application for changes to take effect.
With the newly translated files available, if a user sets the primary language in their browser to a language that matches one of the files available in your Geoportal deployment, the Geoportal will display the resource strings from the matching language file, and thereby display a localized interface.
-
Localize Online Help
The Geoportal offers a context-sensitive help system that links to the WebHelp deployed with the Geoportal. If a user needs help while using the Geoportal, he/she can click the "Help" link at the top of any page, and will be directed to that page's help information in the WebHelp.
The WebHelp contains a wealth of information for regular users, Geoportal publisher users, Geoportal administrator users, and system administrators. To translate the entire help system, you will need to translate files in the \\geoportal\webhelp directory. Similar to how you translated the gpt.properties file to reference a language code, you will need to create a directory within the \\geoportal\webhelp folder with your two or four letter language code. Then copy the files from the "en" folder into your newly created folder. The Index file "geoportal_extension.hhk" requires specific procedures outlined in chapter 7 "HTML Help" in the ArcGIS 9.3.1 Localization Toolkit. The index file controls the webhelp index, and will need to be localized with translated terms for the webhelp index tab.
After the help files have been translated, all files should be saved and the geoportal web application restarted.
With the newly translated files available, if a user sets the primary language in their browser to a language that matches a directory name, the Geoportal help system will display the files from that language's directory and thereby display a localized help system.
-
Localize Mail Messages
Publisher users can request to be notified when the repository they have registered is harvested. These messages are controlled by the "notifMessage.xslt" file in the \\geoportal\WEB-INF\classes\gpt\harvest folder. Because emails are sent when harvesting is instigated and not at the end user's request, there is not a way for the Geoportal to determine in what language the end user prefers to receive email. Therefore, if your organization will be notifying publisher users that speak a variety of languages, it will be important to edit the message in the notfiMessage.xslt file to read in multiple languages.
- Open the notifMessage.xslt file in a text editor
- Edit the text within the <body> tags to read in one or more languages of your choice. Remember not to alter the following placeholders:
-
<xsl:value-of select="repositoryName"/>
name of registered repository
-
<xsl:value-of select="eventData"/>
date of harvest
-
<a href="{reportLink}"><xsl:value-of select="reportLink"/>
link to harvest report
Apache Lucene Search Engine
The Geoportal extension 9.3.1 comes with the Apache Lucene search engine configured for English by default. To enhance performance of the lucene index if your geoportal is using another language, you can use an analyzer that was created for that language. Visit the lucene contrib-analyzers API for Javadoc for optional analyzers.
To change the default language of the lucene engine used in your geoportal deployment, do the following:
- Download the lucene-2.4.0.zip file, which can be found at the Apache lucene archiving location (http://archive.apache.org/dist/lucene/java). This file is the lucene archive that corresponds to the lucene version implemented by the Geoportal 9.3.1.
- Unzip the lucene-2.4.0.zip file and navigate to the lucene-2.4.0\contrib\analyzers directory.
- In that directory, copy the lucene-analyzers-2.4.0.jar and paste it into the \\geoportal\WEB-INF\lib directory.
- Navigate to the \\geoportal\WEB-INF\classes\gpt\config directory, and open the gpt.xml file in a text editor.
- Find the <lucene> element.
- Change the attribute for analyzerClassName to reference the analyzer class that corresponds to the analyzer you want to use. Javadoc for pre-configured analyzer classes are described at http://lucene.apache.org/java/2_4_1/api/contrib-analyzers/index.html. In this example, it is changed to French:
analyzerClassName="org.apache.lucene.analysis.fr.FrenchAnalyzer"
- Save the gpt.xml file and restart Tomcat for your changes to take effect.
-
Note:
It is also possible to create your own analyzer class to include your specific filters. Once you have created and compiled your own analyzer, you can paste it in the \\geoportal\WEB-INF\lib directory. Then, update the gpt.xml file's <lucene> element to reference the analyzer class that you compiled.