Skip to content

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 in LXQt Session Settings → Environment — because otherwise, it will interfere with the following procedure.
  • Uncomment the needed locales in /etc/locale.gen. Example:
    en_US.UTF-8 UTF-8
    en_CA.UTF-8 UTF-8
    
  • Run sudo locale-gen to generate the uncommented locales.
  • Set LANG inside /etc/locale.conf. Example:
    LANG=en_US.UTF-8
    
  • Now, create ~/.config/locale.conf and add session tweaks to it, if any. For example, to keep LANG=en_US.UTF-8 but to use en_CA for the date format, put the following lines in ~/.config/locale.conf:
    LANG=en_US.UTF-8
    LC_TIME=en_CA.UTF-8
    
  • 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:
    2025-1-2 1:00 p.m.
    

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:

LC_NUMERIC
LC_TIME
LC_MONETARY
LC_MEASUREMENT

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.