Complete Contents
Preface
Chapter 1 Gateway Features
Chapter 2 Setting Up the Gateway
Chapter 3 Gateway Localization
Chapter 4 Files Controlling Gateway Functionality
Chapter 5 Entry Types and Object Class Attributes
Chapter 6 Search Attributes, Features, and Results
Chapter 7 Customizing Color and Graphics
Appendix A .conf Parameters
Appendix B Gateway Directives Reference
Appendix C CGI Usage
Appendix D Gateway User Help
Previous Next Contents Index


Chapter 3 Gateway Localization

This chapter describes gateway localization and identifies the tasks required to set up additional gateway locales. Topics include:


Unicode and Netscape Support for UTF-8
Unicode is a character set containing all the characters of all the world's major languages. There are different standard encodings of Unicode, including UCS-2, which is NT's Unicode version, and UTF-8, the version of Unicode specified by version 3 of the LDAP protocol.

Netscape products use UTF-8 in versions 2 and 3 of LDAP. Most software included in the Directory Server product uses UTF-8 internally, and at interfaces other than LDAP (for example in command-line parameters and LDIF files).

The NT Synchronization Server, installed with the Directory Server, converts UTF-8 to and from NT's Unicode representation (UCS-2).

Note. Netscape Communicator 4.x supports UTF-8. Netscape Navigator 3.x does not.


How the Gateway Selects a Character Set
The gateway can output web pages in many character sets. The gateway selects a character set for each HTTP client based on a combination of input from the client and from the gateway's configuration files. Releases 3.x and 4.0 of the gateway select a character set for transmission according to this priority:

How the Gateway Selects from Multiple Requested Character Sets

When a client includes more than one character set in a request header, and the gateway supports more than one of these, it selects a character set according to this priority:

HTTP Clients that Request UTF-8

Browsers designed for localization are configured to request the UTF-8 character set by default. To support localization, the gateway is preconfigured to transmit the UTF-8 character set to these clients: Netscape Communicator version 4.0 and greater and to Internet Explorer version 4.0 and greater. Release 4.0 of the gateway allows this preconfiguration to be overridden using the ignoreAcceptCharsetFrom parameter.


See Also

"ignoreAccetpCharsetFrom" on page 85

The conversion from UTF-8 to the Gateway client's chosen character set is performed shortly before output.

HTTP Clients that Do Not Request UTF-8

For browsers that do not request UTF-8 by default (including Netscape Navigator 3.x and pre-4.0 releases of Internet Explorer), the Gateway selects a character set from the Accept-Charset request header or from the Accept-Language request header, depending on the HTTP client.

Some HTTP clients don't request any character set information. For these clients, the Gateway's charset parameter definition is the default. When the charset parameter is not defined in dsgw.conf, the Gateway uses Latin-1 (which is the default in HTTP).

In addition to UTF-8 and Latin-1, the Gateway can convert to and from several national character sets, depending on the client's needs and configuration, including:


Special Characters
Non-breaking Space

If the client's character set lacks a character for non-breaking space, but has ideographic space, non-breaking spaces are converted to ideographic spaces before character set conversion.

See the changeHTML directive, in the Gateway configuration file dsgw.conf.

Query Strings

When the Gateway needs to embed a UTF-8 string in an URL, it encodes it in a query string (the query string is the part of the URL that follows the question mark).

This works around a problem with Japanese NT, which garbles environment variables that are in UTF-8 (or any character set except Shift_JIS). The web server passes information to the Gateway CGI programs in environment variables, but the query string environment variable $QUERY_STRING is URL-encoded, so it can handle UTF-8 (from NT's point of view, it's ASCII).


Gateway Locales
The Gateway's default language is US English. Release 4.0 of the Directory Server Gateway interface is also translated into the following locales:

Support for Multiple Locales

A single Gateway instance supports clients in multiple locales concurrently.

Support for multiple locales is accomplished by translating documentation (including online help), the string resource database, and the configuration and HTML template files. A single copy of the compiled code handles all supported locales.

Locale-dependent information is stored in translated files stored in subdirectories identifying the locale name. These editable files are stored separately from the Gateway code. For example, the German translation of config/search.html is stored in config/de/search.html, the French translation is stored in config/fr/search.html, and the Japanese translation is stored in config/ja/search.html.


Setting Up Locales for Translation
The default gateway can be configured to support locales in addition to English (the default locale), French, German, and Japanese. This is part of the overall localization effort, which includes localizing all the configuration and HTML files, including the online help and the string resource database.This is made possible by including a pointer to the mapping table in dsgw-l10n.conf, which is stored during Directory server installation in NS-HOME/dsgw/config/<lang>.

dsgw-l10n.conf

dsgw-l10n.conf provides translation in the Search and Advanced Search pull-down menus for the default Gateway (dsgw.conf). If dsgw-110n.conf is not present in the /config/<lang> directory, translation of the UI does not occur and English characters appear in the pull-down menus for Standard Search and Advanced Search.

Example 3.1 shows how to create a new locale using Chinese as the language for translation.

Example 3.1 Creating a locale for Chinese (zh) translation

  1. Create a "zh" directory in NS-HOME/dsgw/context
  2. Copy dsgw.conf to the NS-HOME/dsgw/context/zh
  3. uncomment this line from the Gateway's .conf file:
  4. include "../config/dsgw-l10n.conf"

  5. create a "zh" directory in NS-HOME/dsgw/config
  6. Copy or create the file dsgw-l10n.conf, stored during Gateway installation in NS-HOME/dsgw/config/<lang>, to NS_HOME/dsgw/config/zh
Note. If you are using the US version of the Gateway, dsgw.conf contains a sample of dsgw-l10n.conf.

 

© Copyright 1999 Netscape Communications Corporation