Changes the language settings for system or user.
To Modify the Environment or Profile File Changing the Default Language Setting:
chlang [ -u UID | Uname ] [ -m MsgTransLst | -M ] Language
To Modifiy the Environment or Profile File without Changing the Default Language Setting:
chlang [ -u UID | Uname ] -m MsgTransLst | -M
To Remove the NLSPATH Setting from the Environment or Profile File:
chlang -d [ -u UID | UName ]
The chlang command is a high-level shell command that changes the language settings for either the entire system or an individual user. If the effective id of the invoker is root and the -u option was not used, the language settings will be changed for the entire system in the /etc/environment file. If the effective id of the invoker is not root, or if the -u option was used, the language settings will be changed for an individual user in the user's .profile file.
When chlang is run with a language and no options, the LANG environment variable will be set to the language specified.
When chlang is run with the -m option, the LANG and NLSPATH environment variables will be set. In addition, the LC_MESSAGES variable will be set to the first value specified in the MsgTransLst of the -m flag if it is different from the Language parameter and the Language parameter has a system supplied translation available.
When chlang is run with the -d option, the NLSPATH environment variable will be removed.
Notes:
- Changes made to the NLS environment by chlang are not immediate when either /etc/environment or the user's .profile are modified. Changes to /etc/environment requires rebooting the sytsem. Changes to a user's .profile requires logging in again or running the .profile file.
- When modifying a user's configuration file, if the user uses the C shell (/usr/bin/csh) their .cshrc file will be modified rather than the .profile file.
| Item | Description | 
|---|---|
| -d | Used to remove the NLSPATH environment variable. This option will remove NLSPATH from either /etc/environment or the user's .profile. If NLSPATH was not currently in the file being modified, a warning message will be displayed. | 
| -m MsgTransLst | Used to make modifications to the NSLPATH environment variable. MsgTransLst is a colon-separated list of message translations (locale names) that indicates the message translation hierarchy required for the system or user. If the first language in the list is different from the Language parameter and Language parameter has system supplied translation, then the LC_MESSAGES environment variable will be set to that first value. If the first language-territory in the list is the same as the language being set, the LC_MESSAGES environment variable will be removed. All entries in the list become hard coded directories in the NLSPATH environment. | 
| -M | Used to reset the LC_MESSAGES environment variable
and set the NLSPATH environment variable to the default translation
hierarchy, which is:  | 
| -u UID or UName | Used to make modification to an individual user. The user can be specified by either user id number or user login name. If the effective id of chlang is root, the -u parameter must be used to change the language environment for any specific user ID, including root itself (no -u parameter in this case will update the /etc/environment file rather than root's .profile). If the effective id is not root, the -u parameter is not needed. If it is specified, it must be equal to the effective id of the invoker. | 
| Language | This is the language-territory (locale name) that will become the locale setting for the LANG environment variable. | 
| Item | Description | 
|---|---|
| 0 | Indicates successful completion. | 
| >0 | Indicates an error occurred. | 
chlang -u amcleod -m no_NO:sv_SE:en_US no_NOLANG=no_NO
  
NLSPATH=/usr/lib/nls/msg/%L/%N:
        /usr/lib/nls/msg/no_NO/%N:
        /usr/lib/nls/msg/sv_SE/%N:
        /usr/lib/nls/msg/en_US/%N:
        /usr/lib/nls/msg/%L/%N.cat:
        /usr/lib/nls/msg/no_NO/%N.cat:
        /usr/lib/nls/msg/sv_SE/%N.cat:
        /usr/lib/nls/msg/en_US/%N.catchlang -m fr_CA:en_US fr_FRLANG=fr_FR
 
LC_MESSAGES=fr_CA
 
NLSPATH=/usr/lib/nls/msg/%L/%N:
        /usr/lib/nls/msg/fr_CA/%N:
        /usr/lib/nls/msg/en_US/%N:
        /usr/lib/nls/msg/%L/%N.cat:
        /usr/lib/nls/msg/fr_CA/%N.cat:
        /usr/lib/nls/msg/en_US/%N.catchlang -m es_ES es_ESLANG=es_ES
 
NLSPATH=/usr/lib/nls/msg/%L/%N:
        /usr/lib/nls/msg/es_ES/%N:
        /usr/lib/nls/msg/%L/%N.cat:
        /usr/lib/nls/msg/es_ES/%N.cat| Item | Description | 
|---|---|
| /usr/bin/chlang | Change language command | 
| /etc/environment | Specifies basic environment for all processes | 
| $HOME/.profile | Specifies environment for specific user needs |