Common Desktop Environment: Advanced User's and System Administrator's Guide
Contents of Chapter:
- Managing the LANG Environment Variable
- Setting the Language for Multiple Users
- Setting the Language for One Session
- Setting the Language for One User
- LANG Environment Variable and Session Configuration
- Setting Other NLS Environment Variables
- Finding Fonts
- Localizing app-defaults Resource Files
- Localizing Actions and Data Types
- Localizing Icons and Bitmaps
- Localizing Backdrop Names
- Localizing Palette Names
- Localizing Help Volumes
- Localizing Message Catalogs
- Executing Localized Desktop Applications Remotely
To configure localized desktop sessions, you will need to:
- Resetting Your Keyboard Map
- Set the LANG environment variable and other National Language Support (NLS) environment variables
- Access language-dependent message catalogs and resource files
- Execute applications remotely across internationalized systems
The LANG environment variable must be set for the desktop to use the operating system's language-sensitive routines. The desktop supports:
- Western Europe, Latin-based languages
- Traditional Chinese
- Simplified Chinese
Note: Support for other languages may have been added by your desktop vendor.
You can set LANG to any value supported by the operating system. The Options menu in the login screen displays the list of supported languages and territories.
There are four ways to set LANG for the desktop:
When LANG is set, the desktop uses the following language-dependent files to determine the localized interface.
- By editing a resource in the Xconfig file
- Using the Options menu in the login screen
- By creating an executable sh or ksh Xsession.d script. (See"Sourcing Xsession.d Scripts" for more information about using an Xsession.d script.)
- By editing the user's .dtprofile file
If you set the language by means of an Xconfig file, the login screen is localized and LANG is set for all users. This is the only way to change LANG for all displays in multi-display systems. (To modify Xconfig, copy /usr/dt/config/Xconfig to /etc/dt/config/Xconfig.)
The language is set by placing the following line in /etc/dt/config/Xconfig:
For example, the following line sets LANG to Swedish_locale on display
The dtlogin client reads the appropriate message catalog for that language and brings up the localized login screen. The dtlogin client then determines the list of locales using the following resources in the /etc/dt/config/Xresources resource file:
The Xconfig file may need to set the NLSPATH environment variable appropriately for the chosen language. If this is not the case, or if you want to set NLSPATH yourself, see "NLSPATH Environment Variable".
Setting the Language for One Session
To set the language for one session, use the login screen Options menu. The login screen is localized and LANG is set for the user. LANG returns to its default value (set in dtlogin) at the conclusion of the session.
Setting the Language for One User
A user can override the login's LANG setting within the HomeDirectory/.dtprofile file. The login screen is not localized, and LANG is set for the user.
LANG Environment Variable and Session Configuration
The LANG environment variable changes the directory name that is searched for your session configuration files.
The localized session configuration files are:
- /usr/dt/config/language/Xresources (Login Manager resource file)
- /usr/dt/config/language/sys.font (Session Manager resource file)
- /usr/dt/config/language/sys.resources (Session Manager resource file)
- /usr/dt/config/language/sys.session (Session Manager executable shell)
- /usr/dt/config/language/sys.dtwmrc (Window Manager resource file)
- /usr/dt/appconfig/types/language/dtwm.fp (Window Manager Front Panel)
Setting Other NLS Environment Variables
Besides LANG, there are other NLS environment variables such as LC_CTYPE and LC_ALL. These variables are not affected by the dtlogin language resource nor by the login screen Options menu. They must be set in the following files:
The NLSPATH environment variable determines the directory paths that applications search for message catalogs. Both LANG and NLSPATH must be set to use those message catalogs. Refer to "Localizing Message Catalogs" for the location of localized messages. Most desktop clients will prefix the path to NLSPATH upon startup.
- System-wide variables: /etc/dt/config/Xsession.d
- Personal variables: HomeDirectory/.dtprofile
Fonts included with the desktop are in the /usr/lib/X11/fonts directory. Each directory contains a directory file,
fonts.dir, and an alias file,
fonts.alias. See the
mkfontdir man page for information on creating the
To list all fonts available at a server, user the
xlsfonts command. To add or delete fonts to the server, use the
The default location for the app-defaults file for the desktop clients is /usr/dt/app-defaults/language. For example, if LANG is set to Swedish_locale, then applications will look for their app-defaults file in /usr/dt/app-defaults/Swedish_locale. If LANG is not set, language is ignored, and applications look for their app-defaults file in /usr/app-defaults/C.
To change the location of app-defaults, use the XFILESEARCHPATH environment variable. For example, to move app-defaults to /users, set XFILESEARCHPATH to /usr/app-defaults/language/classname.
If you set XFILESEARCHPATH in HomeDirectory/.dtprofile, the value applies to all desktop and X clients you run. Nonclients will not find their resource files unless you link or copy them into the directory specified by XFILESEARCHPATH.
Note: To customize a file in the /usr/dt/appconfig directory, copy the file to the /etc/dt/appconfig directory prior to customizing.
The search path for action and data-type definition files includes language-dependent directories in:
The search path for Application Manager's configuration files is:
- Personal: HomeDirectory/dt/types
- System-wide: /etc/dt/appconfig/types/language
- Built-in: /usr/dt/appconfig/types/language
- Personal: HomeDirectory/dt/appmanager
- System-wide: /etc/dt/appconfig/appmanager/language
- Built-in: /usr/dt/appconfig/appmanager/language
- File and directory names in this directory are localized.
To localize an icon, edit the icon with Icon Editor and save it in:
If you save it in a different directory, set the XMICONSEARCHPATH environment variable to include the directory where you saved the icon. The XMICONBMSEARCHPATH environment variable controls the path used to search for icons.
Localization of backdrops is done through the use of description files (
desc.language and desc.backdrops). No specific localized directory exists (such as
/usr/dt/backdrops/language) for backdrop files. All locales use the same set of backdrops files but have their own desc.language file containing the translated names of the backdrops.
The description file contains resource specifications for the backdrop names that are translated. For example:
desc.language file is used to retrieve the description of the backdrops for locale language in order to display the backdrop in the Style Manager. If there is a description specification, it will be displayed in the Style Manager backdrops list. Otherwise, the backdrop file name will be used.
Users can add their own backdrop descriptions in the HomeDirectory/.dt/backdrops/desc.backdrops file. This file is used to retrieve the backdrop descriptions for all backdrops added by the user regardless of locale.
The search path for the description files is:
- Personal: HomeDirectory/.dt/backdrops/desc.backdrops
- System-wide: /etc/dt/backdrops/desc.language
- Built-in: /usr/dt/backdrops/desc.language
Localization of palettes is done through the use of description files (
desc.language and desc.palettes). No specific localized directory exists (such as
/usr/dt/palettes/language). All locales use the same set of palette files but have their own desc.palettes file containing the translated names of the palettes.
The description file contains resource specifications for the palette names that are translated. For example:
desc.language file is used to retrieve the description of the palettes for locale language in order to display the palette in the Style Manager list. If there is a description specification it will be displayed in the Style Manager palettes list. Otherwise, the palette file name will be used.
Users can add their own palette descirptions in the HomeDirectory/.dt/palettes/desc.palettes file. This file is used to retrieve the palette descriptions for all palettes added by the user regardless of locale.
The search path for the description files is:
- Personal: HomeDirectory/.dt/palettes/desc.palettes
- System-wide: /etc/dt/palettes/desc.language
- Built-in: /usr/dt/palettes/desc.language
If you have localized a help volume, you must store it in one of the following directories. The first help volume found is the one used. The directories are searched in the following order:
- Personal: HomeDirectory/.dt/help
- System-wide: /etc/dt/appconfig/help/language
- Built-in: /usr/dt/appconfig/help/language
If you have localized a message catalog, store it in the following directory:
These directories contain the *.cat files.
You can invoke localized desktop applications on any remote execution host that has a similarly localized desktop installation. The values of the NLS-related environment variables on the host that is invoking the application are passed to the remote host when the application is started. However, the environment variables do not contain any host information.
If you see unexpected characters and behaviors, or characters cannot be displayed or typed, you might need to reset or install your keyboard map or change your input method.
The input method is determined by the LC_CTYPE, LANG, or LC_ALL environment variables, or the language specified by the
For example, if the user wants to open a terminal with the C locale within a POSIX shell, such as:
This new terminal uses the C locale including the C input method and fonts. If you are using a language-specific keyboard, the input method may not accept any extended characters for input. When using the C locale with a language-specific keyboard, users need to set the LC_CTYPE (or LANG or LC_ALL) environment variable to an appropriate value before invoking the terminal.
For example, to use the C locale with the German keyboard, type:
If the X server has been reset and keymaps have been initialized, you can reset the proper keyboard map at the server using the
LANG=C LC_CTYPE=DeDE dtterm