Changes the language settings for system or user.
chlang [ -u UID | Uname ] [ -m MsgTransLst | -M ] Language
chlang [ -u UID | Uname ] -m MsgTransLst | -M
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./P>
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.
- 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.
|-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.|
|-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:|
|-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.|
|Language||This is the language-territory (locale name) that will become the locale setting for the LANG environment variable.|
|0||Indicates successful completion.|
|>0||Indicates an error occurred.|
chlang -u amcleod -m no_NO:sv_SE:en_US no_NOThe following settings would be made in the .profile for user amcleod. Because the first language in the message translation list is Norwegian, as is the Language parameter, LC_MESSAGES would not be set by chlang. If LC_MESSAGES had been set, it would be removed:
LANG=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.cat
chlang -m fr_CA:en_US fr_FRThe following settings would be made in the .profile file for the user invoking chlang. Because the first language in the message translation list is different from the cultural convention (locale), LC_MESSAGES is set by chlang.
LANG=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.cat
chlang -m es_ES es_ESThe following settings would be made in the /etc/environment file.
LANG=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
|/usr/bin/chlang||Change language command|
|/etc/environment||Specifies basic environment for all processes|
|$HOME/.profile||Specifies environment for specific user needs|
The environment file, profile file format.
National Language Support Overview for System Management in AIX Version 4.3 System Management Guide: Operating System and Devices.
Understanding Locale Environment Variables in AIX Version 4.3 System Management Guide: Operating System and Devices.