Changing Language for an existing user | Just using the Terminal

I do work with the mate desktop and did try to change the language for my user to German. I could do this with the “Mate User Manager”. I already installed a German user on my system so I did not have to install langpacks-de

With localectl i could change the settings as needed.
Reading the manual > System Locale and Keyboard Configuration :: Fedora Docs

How changing the user language to de i tried do find out in this part of the Manual >
Managing Users and Groups :: Fedora Docs I assumed to find it there because with the “Mate User Manager” i do the same ?!

Can someone help me to achieve this totaly in a terminal?

I’m not sure, but I think after ~]# localectl set-locale LANG=..., we need to reboot the system to see the change.

Just test it and reboot doesn’t work.

Not works. I did boot, that’s why i linked the manuals. There is not really a hint how to make the user change for an existing user except the picture how to change in the settings of gnome.

When i do it in the “Mate User Manager” i can log out and log in again and the language is changed. I guess the tool is needed to make the changes just in the DE. And it seams there are differences between them.

It seams there are two different paths to go.

  1. If I just have a text based system, i need to create the initramfs new incl. the boot menu and then it is system wide. But this is not what i want.

  2. While using a Desktop environment i have to do the changes there. It would mean on a gnome DE i would have to do it in dconf somewhere?

The only different when I change the language with Fedora Workstation are in env | grep LANG. Not sure if it possible by adding to .bashrc something like export LANG=....

Update:

Yes just tested, by adding:

export GDM_LANG=en_US.UTF-8
export LANG=en_US.UTF-8

to ~/.bashrc it will overrides setting from Gnome Settings (logout and login again). But not sure with Mate.

What is the exact command you tried? What are the available locales on your system? You can list them with:

localectl list-locales
localectl set-locale de_DE.UTF-8  #i did copy and paste from below and restarted the computer 2 times.

localectl list-locales |grep de_
de_AT.UTF-8
de_BE.UTF-8
de_CH.UTF-8
de_DE.UTF-8
de_IT.UTF-8
de_LI.UTF-8
de_LU.UTF-8

localectl list-locales |grep en_
en_AG.UTF-8
en_AU.UTF-8
en_BW.UTF-8
en_CA.UTF-8
en_DK.UTF-8
en_GB.UTF-8
en_HK.UTF-8
en_IE.UTF-8
en_IL.UTF-8
en_IN.UTF-8
en_NG.UTF-8
en_NZ.UTF-8
en_PH.UTF-8
en_SC.UTF-8
en_SG.UTF-8
en_US.UTF-8
en_ZA.UTF-8
en_ZM.UTF-8
en_ZW.UTF-8

2 Likes

What is the content of the /etc/locale.conf file after running localectl set-locale de_DE.UTF-8 command? Can you log in to a text console from a virtual terminal and check LANG environment variable?

Ctrl & Alt F2 :

Ctrl & Alt F1 #on mate desktop changing back to English :

[luciano@fedy ~] $ env |grep LANG
GDM_LANG=en_US.UTF-8
LANG=en_US.UTF-8
[luciano@fedy ~] $ cat /etc/locale.conf
LANG=de_DE.UTF-8
[luciano@fedy ~] $ dfd
-bash: dfd: command not found
[luciano@fedy ~] $ localectl set-locale LANG=en_US.UTF-8
[luciano@fedy ~] $ cat /etc/locale.conf
LANG=en_US.UTF-8
[luciano@fedy ~] $ 

I confirm that:

works to change the language in virtual terminal and also in a terminal in mate.
In the virtual terminal it just needs export LANG=en_US.UTF-8to change.

What is the essential step that I can make a note in the docs how to change the users env variable to get the language changed without using a GUI? The .bashrc is not really a solution.

1 Like

I have used that command and it indeed changed the language setting on my system. Looks like something is overwriting the value in the /etc/locale.conf file. If you are using Bash, check if there are anything setting the locale in /etc/profile, /etc/profile.d, /etc/bashrc, ~/.bash_profile, ~/.profile, ~/.bashrc, or any other file you use to set environment variables. If you are using another shell, check the related files to set your shell environment.

1 Like

I checked it on a almost new F36 installation. There it is as it should be. Later today when i find time i will check it on my F35 with a new user to confirm if this is just a config problem or a bug in F35.

1 Like

export LANG=de_DE.UTF-8 has to been made manually.