Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

nlsadm(8)

Name

nlsadm - configure national language properties

Synopsis

nlsadm get-console-keymap |
 get-system-locale [-e <locale-environment>] |
 get-timezone
nlsadm list-console-keymap |
 list-locale [-aH] [-o <property>[,...]] 
 	[property=value[,...]] |
 list-timezone
nlsadm set-console-keymap [-f] <keymap> |
 set-system-locale [-f] [-e <locale-environment>] <locale> |
 set-timezone [-f] <timezone>
nlsadm install-locale [-fnv] [-R <dir>] <locale> [...]
 uninstall-locale [-fnv] [-R <dir>] <locale> [...]
nlsadm  -? [subcommand]

Description

The nlsadm utility provides a way to get and set information on specific national language properties. This utility provides a consolidated and convenient way to administer language support features.

The get subcommands gather information on national language properties set in the corresponding SMF service for the given property. It also displays the required information according to the selected input options, in the standard output.

The list subcommands provide information about all supported locales either installed or available for installation. The printed information can be altered by using various options, for example, to include the localized strings for locale names, to print only locales for a given language, to suppress headers, and so on. The list subcommands also provide lists of all supported national language properties such as console-keymaps, timezones, and so on.

The set subcommands set the value of national language properties by modifying the value of the corresponding SMF services for a given national language property such as default system locale, console keymap or timezone.

The install/uninstall locale subcommands install or uninstall necessary packages and set corresponding facets for a given locale.

To set the values of national language properties and to install/uninstall locales, an administrator needs to be granted with the National Languages Support Management rights.

Options

The following option is supported:

–? [subcommand]
–-help

Displays help information. This option stops further argument processing and successfully exits after displaying the appropriate output.

Sub Commands

The following options are supported for the get subcommands:

get-console-keymap

Shows the value of the console keymap currently set in the system.

get-system-locale [–e < locale-environment>] | [–-locale-environment=< locale-environment>]

Prints the default system locale currently set in the system. If <locale-environment> is not specified, all locale environments are displayed.

–e <locale-environment> | –-locale-environment=<locale-environment>

Displays the system locale of the specified environment. The supported values for <locale-environment> are: LANG, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.

get-timezone

Displays the name of the default system timezone set in the system.

The following options are supported for the list subcommands:

list-console-keymap

Shows a list of all supported console keymaps available in the system.

list-locale [–aH] [–o property[,...]] [property=value[,...]]
[–-all-locales] [–-no-headers] [–-output-fields=property[,...]]

Displays a list of available locales. By default only the locales available in the installed packages are shown in the list.

Unless –o option is specified, the default property fields are: locale, lang, territory, codeset, modifier, and flags. By default the output is shown in columns and headers with property field names are printed.

–a, –-all-locales

The output contains not only locales available in the installed packages but it also contains all locales available for installation from IPS package repositories. This could take several minutes depending on the availability of the IPS repositories configured.

–H, –-no-headers

Does not show headers and displays the output in 'ofmt' format (colon-separated format with backslashes in front of colons and backslashes in the data). This format is useful for scripting mode.

–o <property>[,...]
–-output-fields=<property>[,...]

Prints only the specified output fields. Valid <property> values are: codeset, facet, flags, lang, lang_wx[_YZ], locale, modifier, pkg, territory, territory_wx[_YZ], and timezone. lang_wx[_YZ] and territory_wx[_YZ], report the name of the language or territory written in the specified locale where wx is an ISO 639 two-letter code (for example, en) and YZ is an ISO 3166 two-letter code (for example, US). When the localized string is not found for the given language or territory, a minus sign '-' is returned.

The flags column contains a set of flags that indicates the status of the locale:

  • A c in the flags column indicates that the locale is the current locale.

  • An i in the flags column indicates that the locale is installed.

  • An l in the flags column indicates that the locale is a legacy locale.

  • An s in the flags column indicates that the locale is currently set as the default system locale.

The <property> arguments should be presented as a comma-separated list without spaces.

<property>=value[,...]

Filters the output and only displays information that matches the input property value. For example, it is possible to specify a concrete territory value, and the output in that case will show only locales for the given territory. Valid <property> specifiers are: codeset, facet, flags, lang, locale, modifier, pkg, territory, and timezone.

Valid lang value is an ISO 639 two-letter code (for example, en) and valid territory value is an ISO 3166 two-letter code (for example, US).

list-timezone

Shows a list of all supported timezones. The list includes also timezones of the locales available for installation.

The following options are supported for the set subcommands:

set-console-keymap [–f] | [–-force] <keymap>

Sets the given console keymap in the system.

–f
–-force

Force setting a non-valid or unknown value.

set-system-locale [–f] [–e <locale-environment>] < locale> |
[–-force] [–-locale-environment=<locale-environment >] <locale>

Sets the default system locale to given value. Unless –e option is specified, only the LANG environment is set to the given locale.

–f
–-force

Force setting a non-valid or unknown value.

–e <locale-environment>
–-locale-environment=<locale-environment >

Sets the given locale only to the specified locale-environment. The supported values for <locale-environment> are: LANG, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, and LC_ALL.

The following options are supported for the install/uninstall subcommands:

install-locale [–n] [–f] [–R <dir>] [–v] <locale> [...] |
[–-dry-run] [–-force] [–-image-dir=<dir>] [–-verbose] <locale> [...]
uninstall-locale [–n] [–f] [–R <dir>] [–v] <locale> [...] |
[–-dry-run] [–-force] [–-image-dir=<dir>] [–-verbose] < locale> [...]

Installs or uninstalls necessary packages for the given locale. If additional packages or locales need to be installed or uninstalled because of locales or package dependencies, the command reports a list of additional packages and/or locales to install or uninstall. If –-force option is used, the additional packages and locales are also installed or uninstalled.

–n
–-dry-run

Perform a trial run of the operation with no package changes made.

–v
–-verbose

Issue verbose progress messages during the requested operation and display detailed information such as commands used to install/unistall locales or to change facets.

–R
–-image-dir=< dir>

Operate on the image rooted at dir. If no directory was specified or determined based on environment, the default is /. For more information, see the Environment Variables section from pkg(1) man page.

Exit Status

zero

On successful completion

non-zero

When an error is found

Examples

Example 1 Show the Default System Locale Currently set in the locale environment LC_TIME

The following command show the the default system locale currently set in the locale environment LC_TIME:

$ nlsadm get-system-locale -e LC_TIME
Example 2 Set System Timezone to Europe/Paris

The following command shows how to set the system timezone to Europe/Paris:

$ nlsadm set-timezone Europe/Paris
Example 3 Show the Name of the Default Timezone Currently set in the System

The following command shows the name of the default timezone currently set in the system:

$ nlsadm get-timezone
Example 4 Show a List of all Supported Locales Either Installed or Available for Installation

The following command shows a list of all supported locales either installed or available for installation:

$ nlsadm list-locale -a
LOCALE            LANG(en)  TERRITORY(en)  CODESET  MODIFIER  FLAGS
cs_CZ.UTF-8@euro  Czech     Czech Republic UTF-8    euro      il
en_US.UTF-8       English   United State   UTF-8    -         ics
es_ES.UTF-8       Spanish   Spain          UTF-8    -         -
Example 5 Show a List of all Installed Locales According to Specified Fields and do not Show Headers

The following command shows a list of all installed locales according to specified fields and do not show headers:

$ nlsadm list-locale -o locale,lang_en,timezone -H flags=i
Example 6 Set the Default System Locale to fr_FR.UTF-8

The following command shows how to set the default system locale to fr_FR.UTF-8:

$ nlsadm set-system-locale fr_FR.UTF-8
Example 7 Set the LC_CTYPE locale-environment to en_US.UTF-8

The following command sets the LC_CTYPE locale-environment to en_US.UTF-8:

$ nlsadm set-system-locale -e LC_CTYPE en_US.UTF-8
Example 8 Set Console Keyboard Keymap to UK-English

The following command sets the Console Keyboard keymap to UK-English:

$ nlsadm set-console-keymap UK-English
Example 9 Install fr_FR.UTF-8 Locale in the System

The following command shows how to install fr_FR.UTF-8 locale in the system:

$ nlsadm install-locale fr_FR.UTF-8
Example 10 Show Information on a Given Locale

The following command shows information on a given locale by displaying only specified property fields and omitting headers:

$ nlsadm list-locale -o locale,lang,territory -H locale=en_US.UTF-8

en_US.UTF-8:en:US
Example 11 Set Empty Value as Default System Locale

The following command shows how to set the default system locale with an empty value:

$ nlsadm set-system-locale ""

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availibility
system/locale/nls-administration
Interface Stability
Uncommitted

See Also

pkg(1), setlocale(3C), libscf(3LIB), locale_alias(7), smf(7)

Notes

The values for the console-keymap, system-locale, and timezone are managed through the service management facility under the service identifiers. For more information on service management facility, see the smf(7) man page.

svc:/system/keymap:default	  (console-keymap)
svc:/system/environment:init	(system-locale)
svc:/system/timezone:default	(timezone)