You are not logged in.
I followed the instructions for Overriding system locale per user session but I am not able to get the language changed for a specific user.
Here are my exact steps and output.
$ locale -a
C
POSIX
en_US
en_US.iso88591I created ~/.config/locale.conf
$ cat .config/locale.conf
LANG=nl_NL.utf-8Followed by
$ unset LANG
$ source /etc/profile.d/locale.shFinally
$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_US
en_US.iso88591I've even rebooted the system but the language doesn't change for the specific user,
Can someone point out where I am going wrong?
Thanks
Offline
You have to generate the locale first in any case. locale -a shows you which locales you have theorethically available and generated (afaik this has to be done system wide regardless, look at the generating section), use just locale to find out which values are set to which variable.
Last edited by V1del (2019-07-05 08:39:39)
Offline
I thought that I generated the locale when I set it up the first time.
So I would have to run locale-gen again before doing anything else?
Offline
These are all generated and "active" localisations - listed by 'locale -a':
$ locale -a
C
POSIX
en_US
en_US.iso88591There is no nl_NL listed here. If you want to use any locale you should generate if first. Uncomment suitable line in /etc/locale.gen and run command:
locale-genAfter it locale nl_NL will appear after 'locale -a'. Then you can alternate some variable like LANG=, etc., as written on Wiki:
by creating or editing ~/.config/locale.conf
Offline
Thank you. I see where I went wrong with the Wiki - not reading the whole thing through to the point I need to reference.
$ locale -a
C
POSIX
en_US
en_US.iso88591
nl_NL.utf8I created a new user with a ~/.config/locale.conf file
$ cat locale.conf
LANG=nl_NL.utf8When I log in with the new user using MATE, everything is still in English. Even after rebooting the system, everything is still in English.
I'm scratching my head on this one.
Offline
Check if you have any language settings in "Mate Control Center".
Offline
Also the outputs of "localectl" and "locale" (no "-a")
Offline
Check if you have any language settings in "Mate Control Center".
I didn't see any language settings in Mate Control Center.
Also the outputs of "localectl" and "locale" (no "-a")
$ cat .config/locale.conf
LANG=nl_NL.utf8
$ localectl
System Locale: LANG=C
VC Keymap: n/a
X11 Layout: n/a
$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=Offline
I'd say you've no system locale configured and the local locale.conf isn't interpreted by whatever means the session is started.
This is supposed to be done by /etc/profile.d/locale.sh
pacman -Qikk filesystem 2>&1 | grep profileIf that's clean, log into a console session (boot the multi-user.target and log in as you user) and check the locales there. You can also just start another "bash --login" shell (what should source /etc/profile)
Offline
pacman -Qikk filesystem 2>&1 | grep profileThat returns nothing.
Here is what my /etc/profile.d/locale.sh is showing
]$ cat /etc/profile.d/locale.sh
#!/bin/sh
# load locale.conf in XDG paths.
# /etc/locale.conf loads and overrides by kernel command line is done by systemd
# But we override it here, see FS#56688
if [ -z "$LANG" ]; then
if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
. "$XDG_CONFIG_HOME/locale.conf"
elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
. "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
. /etc/locale.conf
fi
fi
# define default LANG to C if not already defined
LANG=${LANG:-C}
# export all locale (7) variables when they exist
export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \
LC_IDENTIFICATIONOffline
If that's clean, log into a console session (boot the multi-user.target and log in as you user) and check the locales there. You can also just start another "bash --login" shell (what should source /etc/profile)
It would seem however you start the session does not source /etc/profile - what means we probably should look at your DM, being…?
Offline
I am using xrdp to remote into the desktop environment.
Here is my .xinitrc
$ cat .xinitrc
#!/bin/bash
#
# ~/.xinitrc
#
# Executed by startx (run your windows manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/* ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
exec mate-sessionOffline
So you're using startx to run this? Or xinit?
Out of an interactive shell or do you kinda autologin/autorun it? (guessing because of xrdp)
Also (the d'ohh moment ;-)
Is the ~/.config/locale.conf on the remote or the local system?
Offline
I'm using Windows 7 to remote into Arch, so everything is going from the ~/.xinitrc file to start the desktop manager.
Everything is on the remote system that will later be replacing Windows 7 completely.
Offline
So you're using startx to run this? Or xinit?
Out of an interactive shell or do you kinda autologin/autorun it? (guessing because of xrdp)
"Desktop manager" doesn't sound like as if xinitrc was relevant at all, afaik only xdm uses xinitrc.
Offline
In the .xinitrc file, if I change
exec mate-sessionwith
exec startxfce4it will load XFCE instead of MATE.
Of course that is if I am using xrpd. Locally, it uses LightDM but I do not have direct access at the moment to test the changes in person.
Offline
So xrdp starts the session - and probably does nowhere source /etc/profile
add
. /etc/profile at the top of your xinitrc. Idk. whether xrdp allows you to manipulate its shell loading process.
Remove it later on to avoid double sourcing of /etc/profile
Offline
Sorry for the lack of updates. Work and life has taken over my free time...
I have an exact local test system so I am able to remove the xrdp out of the mix.
Here is what is going on now:
I log in from a shutdown state or reboot and here is the following outputs of locale -a, locale and localectl.
$ locale -a
C
dutch
en_US.utf8
nl_NL
nl_NL@euro
nl_NL.iso88591
nl_NL.iso885915@euro
nl_NL.utf8
POSIX...
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=...
$ localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: n/a
X11 Layout: n/aFrom here I will run unset LANG and source /etc/profile.d/locale.sh
$ unset LANG
$ source /etc/profile.d/locale.shHere is the updated locale
$ locale
LANG=nl_NL.utf8
LC_CTYPE="nl_NL.utf8"
LC_NUMERIC="nl_NL.utf8"
LC_TIME="nl_NL.utf8"
LC_COLLATE="nl_NL.utf8"
LC_MONETARY="nl_NL.utf8"
LC_MESSAGES="nl_NL.utf8"
LC_PAPER="nl_NL.utf8"
LC_NAME="nl_NL.utf8"
LC_ADDRESS="nl_NL.utf8"
LC_TELEPHONE="nl_NL.utf8"
LC_MEASUREMENT="nl_NL.utf8"
LC_IDENTIFICATION="nl_NL.utf8"
LC_ALL=The locale -a and localectl remain unchanged.
The language still remains unchanged and when I log off and/or reboot, locale reverts back to en_US.UTF-8.
Offline
I log in …
How and into what?
A non-login bash that you start later on in xterm or so isn't expected to source /etc/profile
The language still remains unchanged
Language where? This will only affect processes started after the change and from the shell where you sourced /etc/profile.d/locale.sh
Offline
I am using LightDM to log into Mate locally.
The user I am logging in with has a ~/.config/locale.conf file configured per the wiki.
Offline
There is something strange here. Could you post the whole content of your /etc/locale.gen?
$ cat /etc/locale.genLast edited by lucas2santos (2019-08-14 21:43:18)
Offline
He doesn't have a problem w/ the locale per se, but /etc/profile.d/locale.sh isn't sourced by the session for whatever reason.
@CK_Jazz, lightdm is supposed to invoke a session wrapper, by default /etc/lightdm/Xsession (which in turn would source /etc/profile among others) - did you change anything?
What if you
a) do NOT unset LANG
b) source /etc/profile instead of the language script?
Offline
He doesn't have a problem w/ the locale per se, but /etc/profile.d/locale.sh isn't sourced by the session for whatever reason.
His locale.conf is set as "nl_NL.utf8". Shouldn't it be "nl_NL.UTF-8" instead, as it should be in locale.gen file?
Last edited by lucas2santos (2019-08-14 22:04:23)
Offline
The entry nl_NL.UTF-8 UTF-8 is listed by `locale -a` as nl_NL.utf8 indicating locale recognizes and will accept that string.
Offline
Hi, opening this thread as I ran into the same issue.
Archlinux
Minimal mate-desktop setup
Multiuser environment with ldap authentication
Xrdp set-up for my users to connect to this server
As some users are Dutch, some are English and some speak yet another language, I needed to set-up the language in mate desktop environment when they connect to xrdp. Xrdp does source the system locale, however will not look into the user's override as suggested in this post as well in ~/.config/locale.conf
Fix:
Place your desired locale in ~/.config/locale.conf, for example LANG=nl_NL.UTF-8
In /etc/xrdp/startwm.sh just after #start the window manager, unset the LANG variable and source the /etc/profile.d/locale.sh:
....
#start the window manager
wm_start()
{
if [ -r /etc/locale.conf]; then
. /etc/locale.conf
export LANG LANGUAGE
fi
#additional config added here to override the language settings, should they be configured in a user's ~/.config/locale.conf:
unset LANG
source /etc/profile.d/locale.sh
....
No need to restart xrdp, just login again with the user affected and it should work instantly.
Offline