HPlogo Using the X Window System > Chapter 3 Preliminary Configuration

Customizing for Native Language Support (NLS)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

This section covers:

  • How X uses the LANG environment variable and other environment variables.

  • Accessing language-dependent message catalogs and resource files.

  • Remote execution in NLS systems.

Setting the LANG Environment Variable

The LANG environment variable must be set in order to use native language support. Setting LANG causes X to use the language-sensitive routines for character handling.

You can set LANG to any locale that your system supports.

To find out what locales are available to your system, type:

   locale -a

To find your current language settings, type:

   locale 

To set the LANG variable:

   LANG=language

   export LANG

(This shows the ksh commands. If you are using another shell, use the appropriate command for setting environment variables in that shell).

This example sets the LANG variable to Spanish:

   LANG=es_ES.roman8

   export LANG

Other NLS Environment Variables

This section covers other NLS environment variables. It provides an overview only. For detailed information, refer to X Toolkit Intrinsics Programming Manual.

Message Catalogs—The NLSPATH Environment Variable

The NLSPATH environment variable determines the paths applications search for NLS message catalogs. X clients place NLS message catalogs in client-specific locations, allowing translated catalogs to be shared. For example, HP VUE's Vuepad places its catalog in the /usr/lib/nls/msg/$LANG directories.

It shouldn't be necessary to set NLSPATH unless the message catalogs are installed in non-standard locations.

The proper value of NLSPATH depends on whether message catalogs exist for the current value of LANG.

Setting the XUSERFILESEARCHPATH Environment Variable

The XUSERFILESEARCHPATH environment variable controls where X applications look for their app-defaults resource files. The default app-default location is :

   /usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S

If your app-defaults is in any other location, you need to set the XUSERFILESEARCHPATH, XAPPLRESDIR, or XFILESEARCHPATH variables described later in this section.

For example, to use Japanese app-defaults you would set XUSERFILESEARCHPATH to /usr/lib/X11/ja_JP.eucJP/app-defaults. Or, you could set XAPPLRESDIR to /usr/lib/X11/%L/app-defaults and LANG to "ja_JP.eucJP". If LANG is not set, %L defaults to null.

If you set XUSERFILESEARCHPATH in $HOME/.profile, the value applies to all X clients you run. Non-clients will not find their resource files unless you link or copy them into the directory specified by XUSERFILESEARCHPATH.

Setting the KBD_LANG Environment Variable

X allows you to override the physical keyboard attached to the HP-HIL.

Some applications use the environment variable KBD_LANG allowing you to change the keyboard mapping to that of another national language keyboard.

NOTE: Due to changing keyboard standards and the need for interoperability with non-Hewlett Packard system, this capability is being phased out. Do not depend on the KBD_LANG variable, since it may not be available in future releases.

This variable can be set after the server has started. The NLIO processes for Asian users start only when either the physical keyboard is Asian or KBD_LANG is set to an Asian language.

Language-Dependent Bitmaps—the XBMLANGPATH Variable

The XBMLANGPATH variable specifies the search path for language-dependent bitmaps. It lists the paths for bitmaps in this order:

  1. User-specific bitmaps.

  2. System bitmaps listed in the XmGetPixmap(3x) man page.

  3. Append:

       /usr/lib/X11/bitmaps/%N/%B
    
    This ensures that you will get the non-localized bitmaps, where necessary.

Other Language-Dependent Resource Files

When LANG is set, mwm uses the following language-dependent default resource file:

   /usr/lib/X11/%L/system.mwmrc

Native Language Fonts

For information about using non-English fonts, refer to "Using Native Language Input/Output" in chapter 6.

© 1995 Hewlett-Packard Development Company, L.P.