Korean Solaris System Administrator's Guide

Chapter 2 System Environment

Users can change their locale settings with shell environment variables. Each category names an existing locale. The setlocale() function directly sets or queries the setting of these categories. Internationalized functions use these settings to access the appropriate tables for the desired locale.

Environment variables can indirectly set the categories: when setlocale() sets the categories to the default setting for that site, it uses the setting of each environment variable to set the associated categories. The setlocale() function does not change the settings of environment variables, it only reads their settings.

Changing the Default Locale

You can change the default locale system-wide with the following procedure.

  1. Edit the /etc/default/init file by adding or changing the line.

    Substitute C, ko, or ko.UTF-8 for locale.


    LANG=locale 
    
  2. Have all users exit CDE.

  3. Type the following commands:


    % su
    # /usr/dt/bin/dtconfig -kill
    
  4. Type the following commands:


    % su
    # reboot
    

Locale and Category Terminology

The terms locale and category relate to each other as follows:

The environmental variable LC_ALL explicitly sets the same locale for all categories; it has the highest priority. If categories or LC_ALL aren't set, the LANG environmental variable will determine the category setting.

Keybinding for the htt Input Server

In reference to the Korean window system input server, the keybinding process links certain keys on the keyboard with certain actions by an application. You can keybind a complex action by an application, such as closing an application's open windows, to a single key or sequence of keys like Control-H or Esc w c.

All input conversion mode Control-key commands associated with non-ASCII input conversion are set in /usr/lib/mle/ko/keybind.dat and /usr/lib/mle/ko.UTF-8/keybind.dat, depending upon the locale setting. The default commands are listed in the table at the end of Chapter 4, "Entering Korean Input," in Korean Solaris User's Guide.

Customizing Keybinding Control Keys

Keybindings can be changed by changing the names of the keys in keybind.dat and restarting the htt input server. You can create and use your own customized keybind.dat file as follows:

  1. Create a customized copy named keybind.dat in another directory.

  2. Set the environment variable MLE_PATH to the path name of the directory containing this customized file.

  3. Start the input server.

    The directory set in MLE_PATH is searched for an instance of the keybind.dat file and the commands in that file are set for the user.

    If MLE_PATH is not set or does not contain a usable keybind.dat file, /usr/lib/mle/ko/keybind.dat or /usr/lib/mle/ko.UTF-8/keybind.dat is used, according to the locale.

    To change the keybindings, edit the keybinding file to replace default keys with new keys. Key combinations and ON/OFF toggling can also be used.

Interfacing with the Korean Solaris Localization Facility

At the C-shell level, each environment variable can be set to locale (ko or ko.UTF-8 for Korean or C for ASCII) by a shell command as follows:

    C-shell users can enter a shell command as follows:


system% setenv LC_TIME locale 

    Bourne shell (sh) users can use set or export:


$ set -a LC_TIME
$ LC_TIME=locale 

or


$ LC_TIME=locale
$ export LC_TIME 

Setting the locale to ko or ko.UTF-8 allows the user's environment to display time in Korean format and text. A user can define a mix of locales for the working environment. For example, characters can be typed and converted in Korean, time can be displayed in French format and messages can appear in English.

Many users work in a single cultural environment. The LC_ALL and LANG environment variables set the system default for all categories. For example, these C-shell commands set the system default for all categories to locale.


system% setenv LC_ALL locale
system% setenv LANG locale 

System administrators or users can set the default, and the setenv syntax can be used in programming.

This setting is put into effect the next time a setlocale() function call in an application program line sets a category to the default setting: setlocale(LC_XXX, "")