- customize and build new locales
/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.
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. 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:
Specify the path to the C compiler that is used to compile the locale data into a shared object binary. Not required if the compiler is already in the user's PATH.
Specify the path to the directory where the created package is to be stored.
Displays the usage message.
The full path to user defined pkginfo(4) template file.
Specify a comma-separated list of locale(s) to generate. Locale names are in the form: locale.codeset@variant, where codeset and variant are optional. The default and only allowed codeset is UTF-8. The default variant is localectr.
The package name prefix
Queries localectr for a complete list of locales for which locale data is defined in localectr. When localectr is run from the CLI, the locale(s) specified with the -l option must be on this list in order for an installable locale package to be generated.
Specify the range of Unicode characters for which locale data rules in the LC_CTYPE and LC_COLLATE categories are to be generated. There are three valid options:
Locale data rules are restricted to the exemplar or to commonly used characters of the locale in question.
Locale data rules are restricted to the Unicode plane 0 characters, whose codepoints fall in the range u0000-uFFFF.
Locale data rules are generated for all codepoints defined in the latest version of Unicode that is supported by the system on which localectr is being run.
Shows the version of this software.
例 1 Launching the GUI
The following example launches the localectr GUI.
例 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
例 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
例 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:
An error occurred.
Wrapper script that launches locale creator.
Jar files, scripts, and locale data repository needed to run the application.
See attributes(5) for descriptions of the following attributes:
Interface stability is Committed for command-line options and is Uncommitted for other interfaces.
dtlogin(1X), gdm(1)(these are not SunOS man pages)
International Language Environments Guide