To customize and thus create a new locale from existing locales, you need to prepare at least three locale definition source files:
localedef source file – Contains necessary definitions for the locale.
charmap source file – Contains mappings between code point values and human-readable symbolic names. The symbolic names are used in the localedef source file. The charmap source file also contains other definitions, such as the codeset name of the locale, the maximum number of bytes that can be represented in a locale code point, and so on.
The locales provided by the system have their respective locale definition data files available in source/locale/localedef package. These can be useful when only a slight change in existing system locale is required.
$ pkg install source/locale/localedef
# mkdir mynewlocale # cd mynewlocale # cp /usr/lib/localedef/src/charmaps/UTF-8.charmap \ /usr/lib/localedef/src/extensions/UTF-8.x \ /usr/lib/localedef/src/locales/fr_FR.UTF-8.src
# localedef -f UTF-8.charmap -x UTF-8.x -i fr_FR.UTF-8.src fr_FR.UTF-8@custom
# mkdir /usr/lib/locale/fr_FR.UTF-8\@custom # cp fr_FR.UTF-8\@custom /usr/lib/locale/fr_FR.UTF-8\@custom/
$ export LANG=fr_FR.UTF-8@custom