Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

Managing the LANG Environment Variable

The LANG environment variable must be set for the desktop to use the operating system's language-sensitive routines. The desktop supports:


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.

Colors—/usr/dt/palettes/desc.language

Backdrops—/usr/dt/backdrops/desc.language

Setting the Language for Multiple Users

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:

dtlogin.host_display.language: language 

For example, the following line sets LANG to Swedish_locale on display my_host:0.

dtlogin.my_host_0.language: Swedish_locale 

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=language
 	export LANG 
	setenv LANG language

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:

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:

NLSPATH Environment Variable

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.