Solaris Common Desktop Environment: User's Guide

Appendix B Running Localized Sessions

You can customize the desktop user interface in many different languages. Various elements such as screens, default languages, fonts, input (keyboard) methods, and icons can be changed. In addition, the menus, online help, and error messages can be localized and are available in multiple languages.

Default Language at Login

The messages and menus in the initial login window are displayed in the default language. If the default language has not been set up, the messages and menus are displayed using a generic "C" locale environment. You can change the language from the Options menu in the login screen.

Logging In to a Language-Specific Session

Logging in to a specific language through the desktop is easy. However, specific hardware requirements such as keyboards and printers may be required to make the localized session more usable. These requirements vary by language, character set, and country. Software and fonts can further increase the effective localization of your system. To log in to a language-specific session:

  1. Use the Options menu in the login screen to select a language.

    The list of languages includes all the supported languages.

  2. Log in normally with your name and password.

Creating or Editing a Language-Specific File

You can create, edit, and print language-specific files. You can also give files language-specific names. However, for system administration files that are shared across a network, the file names should just contain ASCII characters. Different systems on the network might be using different locales.

If you have logged in to the desktop in a specific language, all applications will be invoked using that language. However, you can still invoke an application with another language.

If you want to create a file with a different language, invoke a new instance of Text Editor specifying your desired language.

To Create or Edit a Language-Specific File

  1. In a Terminal window, set the LANG environment variable to the desired language. For example, to set the locale to Japanese, you can type:


    where Japanese_locale sets the value of the LANG environment variable for the Japanese character set. Refer to your specific platform to determine the value for Japanese_locale.

  2. In the same window, call Text Editor (dtpad) under the desired language by typing:

      /usr/dt/bin/dtpad &

    To start Text Editor with the Japanese language directly, type:

    /usr/dt/bin/dtpad -xnllanguage Japanese_locale

    You can now enter Japanese characters if the locale-specific files have been installed. You can also use the Text Editor session to edit a previously created Japanese file.

    See "To Specify Fonts from the Command Line" for an example of specifying a font set.

Using a Language-Specific Terminal Emulator

The following example uses dtterm and will start a Japanese terminal emulator. It assumes that the default language is not Japanese, that you are using the Korn shell, and that the locale-specific files have been installed.

    From a command line in a Korn shell Terminal window type:

LANG=Japanese_locale dtterm 

where Japanese_locale sets the value of the LANG environment variable for the Japanese character set. Refer to your specific platform to determine the value for Japanese_locale.

Specifying Fonts

The user usually changes fonts using Style Manager, which in turn restarts Workspace Manager, resetting the desktop fonts. You can also customize fonts at the command line or in resource files. In an internationalized environment, the user must specify fonts that are independent of the code set. This is necessary because the specification can be used under various locales with different code sets than the character set (charset) of the font. Therefore, all font lists should be specified with a font set.

Font Specification

A font specification within a fontlist can be either an X Logical Function Description (XLFD) name or an alias for the XLFD name. For example, the following are valid font specifications for a 14-point font:

-dt-interface system-medium-r-normal-serif-*-*-*-*-p-*-iso8859-1 
Or, -*-r-*-14-*iso8859-1

Font Set Specification

The font set specification within a fontlist is a list of XLFD names or their aliases (sometimes called a base name list). The names are separated by semi-colons, and any blank space before or after the semicolon is ignored. Pattern-matching (wildcard) characters can be specified to help shorten XLFD names.

A font set specification is determined by the locale that is running. For example, the Japanese locale defines three fonts (character sets) necessary to display all of its characters. The following example identifies the set of Mincho fonts needed.

The preceding two cases can be used with a Japanese locale as long as there are fonts that match the base name list.

Changing Fonts

You can change the fonts of dtterm by using either of the following methods:

To Specify Fonts from the Command Line

To change the fonts for the menu from the command line, type:

dtterm -xrm '*fontList: fontset'

where fontset is a font set specification. A font set specification can be specified by a full X Logical Font Description (XLFD) name list, a simple XLFD pattern, or an alias name. Note that a font set specification is determined by the locale that is running.

For example, to use a larger font except for the menu font, type:

dtterm -xrm '*fontList:-dt-interface user-medium-r-normal-l*-*-*-*:'

To use a smaller font except for the menu font, type:

dtterm -xrm '*fontList:-dt-interface user-medium-r-normal-s*-*-*-*:'

These specifications will work for any locale.

To Specify Fonts within a Resource File

For example, to change the fonts for the dtterm command in a resource file:

  1. Edit the Dtterm resource file in the /usr/dt/app-defaults/language directory.

    You can use either the class name (Dtterm) or the application name (dtterm) for a resource file of Dtterm.

    Also, setting the LANG environment variable alters the search path of resource files to include the /usr/dt/app-defaults/language directory, where language is the locale name.

    After setting the LANG environment variable, the search path for resource files would include the following two folders:

  2. Insert the font set you want to use at the bottom of the file.

    For example, to use a monospace font, put this line at the bottom of the file:

    dtterm -fn -dt-interface user-medium-r-normal-*-*-*-*
  3. Save the file.

Choosing Your Input Method and Keyboard

Each locale has a single default input method associated with it. If the user does nothing, this default is selected. Because there may be many input methods installed at any one time, the following sections explain how various input methods are selected on behalf of the user.

Using Input Method Modifiers

When there is more than one input method for a locale, use the XmNinputMethod resource to identify the one you would like used. This is done by specifying a modifier. The modifier must be of the following form, where modifier is the name used to uniquely identify the input method:

inputMethod :@im=modifier

The modifier string specified in the XmNinputMethod resource is used to choose which input method is used.

Alternatively, set the XMODIFIERS environment variable. The syntax is the same as for the XmNinputMethod resource, but values are not. Values for XMODIFIERS are vendor specific.

Specifying the Input Method Style

The input method style determines how pre-editing will occur. It is controlled by the XmNpreeditType resource. The syntax, possible values, and default value type of the XmNpreeditType resource are:



Possible values  

OverTheSpot, OffTheSpot, Root, None 

Default value 

OverTheSpot, OffTheSpot, Root 

The string list, separated by a comma, specifies the priority order for this resource. The first value supported by the input method is used.

For more information, see the Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide.

Changing the X Keyboard Map at the Server

If the keymaps currently used by the X server do not match the physical keyboard on the system, you can change them manually by using the xmodmap command or a vendor keyboard mapping utility. For information on the xmodmap command, type man xmodmap.