Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
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:

    LANG=Japanese_locale

    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.

  • Sample name list with character set:

    -dt-interface system-medium-r-normal-serif-*-*-*-*-p-*-14;
    -dt-mincho-medium-r-normal--14-*-*-m-*-jisx0201.1976-0;
    -dt-mincho-medium-r-normal--28-*-*-*-m-*-jisx0208.1983-0:
  • Sample single pattern name without character set:

    -dt-*-medium-*-24-*-m-*:

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:

  • Specifying fonts from the command line

  • Specifying fonts within a resource file

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.

 
 
 
  Previous   Contents   Next