Setting Locale#
WARNING: The following method is tested on Arch. Please consult your distro's documentation before doing anything!
To set the locale correctly (on Arch),
- First, make sure that the session locale is not set in another way, e.g., by a script file like
~/.bashrc
, or inLXQt Session Settings → Environment
— because otherwise, it will interfere with the following procedure. - Uncomment the needed locales in
/etc/locale.gen
. Example: - Run
sudo locale-gen
to generate the uncommented locales. - Set
LANG
inside/etc/locale.conf
. Example: - Now, create
~/.config/locale.conf
and add session tweaks to it, if any. For example, to keepLANG=en_US.UTF-8
but to useen_CA
for the date format, put the following lines in~/.config/locale.conf
: - Log out and log in again to see the effect. For example, with the above vaules, the date columns of PCManFM-Qt will become like this:
It is recommended to make tweaks locally, although they can also be made globally, inside /etc/locale.conf
.
Some environment variables that can be tweaked in this way:
NOTE:#
Unfortunately, GUI tools for setting locales may lead to inconsistencies and create problems, especially in non-Qt apps. The most common problems are related to messages like "Locale not supported by C Library" when launching a GTK app; also, XTerm may not work at all.
The root cause of such issues is usually that a region is set in those tools without its corresponding locale being generated by locale-gen
in the first place.