/usr/bin/localectr -l locale1,locale2... [-d destination_path] [-c compiler_path] [-r 0 | 1 | 2] [-i pkginfo_template] [-p pkgname_prefix]
The localectr utility allows new locales to be customized and built. The output of localectr is an installable package containing the compiled shared object binary which contains the locale data information as well as a number of other supporting files that are required to have a fully working locale on the system.
Once generated, the package can be added to the system by using the pkgadd(1M) command and removed with pkgrm(1M).
Depending on your default system login, you might have to reset your user environment after you add a locale. If dtlogin(1X) (for the CDE user environment) is the default system login, you need to restart dtlogin. No action is required if gdm(1) (for the Gnome user environment) is the default login.
There are two interfaces to localectr, command line (CLI) and graphical user interface (GUI). To customize the locale data, you must use the GUI. To create locales with standard locale data according to Unicode's Common Locale Data Repository (CLDR), the CLI is sufficient.
With the CLI it is also possible to generate several locales in a single step, with a separate package being generated for each locale. With the GUI, a single locale is processed at a time.
To launch the GUI, run the localectr command with no options. To run from the CLI, use the appropriate options as described below.
localectr uses the localedef(1) utility to build the locale data binary shared object. Therefore, access to a C compiler is required in order to run localectr successfully, as this is also required by localedef.
localectr is mainly concerned with locale data. However, in order to create a fully working locale on the system with localectr, many features, such as fonts, translations and input methods, are also required. Depending on what locales are already installed on the system, the relevant features might or might not be present on the system. If they are not present, then localeadm(1M) should be used to add the relevant packages before adding packages created by localectr. localectr bundles locale data for the latest set of locales available in Unicode's CLDR. A user can also create a locale not available in CLDR by supplying her own data in the localectr GUI.
The following options are supported:
Example 1 Launching the GUI
The following example launches the localectr GUI.
Example 2 Generating Locale for Afrikaans (South Africa) with Default Locale Data
The following example generates a package in the specified destination directory, which can be used to install the Afrikaans (af_ZA.UTF-8) locale on the system. The package name is composed of a prefix followed by the hyphen separated ISO-639 language code, the ISO-3166 country code, the locale encoding and an optional user-defined tag. The resulting package can then be added to the system using pkgadd(1M).
example% localectr -l af_ZA -d /tmp
Example 3 Generating Several South Africa Locales with Full Unicode Range of Characters
The following example generates an installable package for each of the specified locales.
example% localectr -l af_ZA,en_ZA,xh_ZA,zu_ZA -d /tmp -r 2
Example 4 Generating the Irish Locale with a User-Specified Tag
The following example will generate a locale whose full name is ga_IE.UTF-8@mycompanyname.
example% localectr -l ga_IE@mycompanyname -d /tmp
The following exit codes are returned:
See attributes(5) for descriptions of the following attributes:
Interface stability is Committed for command-line options and is Uncommitted for other interfaces.
locale(1), localedef(1), localeadm(1M), pkgadd(1M), pkgrm(1M), pkginfo(4), attributes(5)
dtlogin(1X), gdm(1)(these are not SunOS man pages)
International Language Environments Guide