Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
18.   Configuring Localized Desktop Sessions Managing the LANG Environment Variable Setting the Language for Multiple Users  Previous   Contents   Next 
   
 

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.

  • If you use sh or ksh:

	LANG=language
 	export LANG 
  • If you use csh:

	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:

  • /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:

  • System-wide variables: /etc/dt/config/Xsession.d

  • Personal variables: HomeDirectory/.dtprofile

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.

Finding Fonts

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 fonts.dir and fonts.alias files.

To list all fonts available at a server, user the xlsfonts command. To add or delete fonts to the server, use the xset command.

Localizing app-defaults Resource Files

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.

Localizing Actions and Data Types


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:

  • Personal: HomeDirectory/dt/types

  • System-wide: /etc/dt/appconfig/types/language

  • Built-in: /usr/dt/appconfig/types/language

The search path for Application Manager's configuration files is:

  • 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.

Localizing Icons and Bitmaps

To localize an icon, edit the icon with Icon Editor and save it in:

/etc/dt/appconfig/icons/language

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.

Localizing Backdrop Names

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 backdrop 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:

Backdrops*Corduroy.desc:					Velours
Backdrops*DarkPaper.desc:					PapierKraft
Backdrops*Foreground.desc:				AvantPlan

The 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

 
 
 
  Previous   Contents   Next