Locale settings in Manjaro Awesome Edition

locale
awesome-wm

#1

I use the Awesome-wm flavour of Manjaro.

When I start Emacs the variables:

LC_CTYPE 
LC_COLLATE 
LC_MESSAGES

are not set, which in turn causes problems when using R from inside Emacs.
While it is simple to set them from Emacs init file, still I would like to understand what is happening in the background.

localectl status gives:

System Locale: LANG=en_US.UTF-8
              LC_NUMERIC=en_GB.UTF-8
              LC_TIME=en_GB.UTF-8
              LC_MONETARY=en_GB.UTF-8
              LC_PAPER=en_GB.UTF-8
              LC_NAME=en_GB.UTF-8
              LC_ADDRESS=en_GB.UTF-8
              LC_TELEPHONE=en_GB.UTF-8
              LC_MEASUREMENT=en_GB.UTF-8
              LC_IDENTIFICATION=en_GB.UTF-8
   VC Keymap: us
  X11 Layout: us
   X11 Model: pc105

and of course /etc/locale.conf shows the same key-pairs.
Note that the three variables above are missing, however Manjaro locale settings GUI shows in the Details tab the correct values for Collation and Sorting, Messages and CType. As regards locale, it gives:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=

which includes the three missing variables and matches the GUI.

env instead shows only the variables given by localectl status, so not LC_CTYPE etc. Since Emacs reads the environment variables, this explains why it does not report them.

If in the Manjaro GUI settings, I set the Collation and Sorting to en_GB.UTF-8, the related LC_COLLATE is added in /etc/locale.conf, but if I set the entry to en_US.UTF-8 (the same as LANG), LC_COLLATE is removed from the locale file. Is this the expected behaviour?

If I force en_US.UTF-8, by manually setting in /etc/locale.conf

LC_COLLATE="en_US.UTF-8"

and reboot, then localectl status keeps not reporting it, env instead adds this variable to its list and with the correct value, which consequently Emacs receives.

Is it normal to have a mismatching between
localectl, env and locale?

Is Manjaro locale settings GUI a wrapper around localectl and which files is supposed to affect?


#2

https://gitlab.manjaro.org/applications/manjaro-settings-manager