How to Generate Locales on Arch Linux

Locale names are typically of the form language[_territory][.codeset][@modifier], where language is an ISO 639 language code, territory is an ISO 3166 country code, and codeset is a character set or encoding identifier.

a) Listing the Enabled Locales

locale -a

The output may look like this:

ar_SA.utf8
bn_BD
bn_BD.utf8
C
C.utf8
en_GB.utf8
en_US.utf8
POSIX
ru_RU.utf8

b) Selecting Locales

Edit the /etc/locale.gen file on your favorite text editor with superuser privileges, uncomment the desired entries, and comment out or leave commented the non-applicable entries.

.......
ar_SA.UTF-8 UTF-8
#ar_SA ISO-8859-6
bn_BD UTF-8
#bn_IN UTF-8
en_GB.UTF-8 UTF-8
#en_GB ISO-8859-1
en_US.UTF-8 UTF-8
#en_US ISO-8859-1
#ru_RU.KOI8-R KOI8-R
ru_RU.UTF-8 UTF-8
#ru_RU ISO-8859-5
.......

UTF-8 is recommended over other character sets.

c) Generating Locales

Run to generate the enabled locales.

sudo locale-gen

locale-gen also runs with every update of glibc.


Documentation

Abdullah As-Sadeed

Abdullah As-Sadeed