Trying to change locale / date format in openSUSE Tumbleweed

Hello,

My name is Jaymo, and I am a recent openSUSE Tumbleweed convert (I have played around with it in the past, but seriously changing over to the gecko now).

Support Question:

Distribution: OpenSUSE Tumbleweed

Desktop Environment (DE): MATE 1.28

Issue at Hand: I am trying to set my system’s locale to English (Canada) especially for it to show the date in the ISO format we’re used to in Canada (YYYY-MM-DD). However, no matter what, it still sets the locale to en_US, and output of the locale command is:

locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

What I have Tried: I set it in YaST, which told me that YaST itself would need to use the fallback language of en_US, which is ok.
I set it in localectl, which was successful, and a cat of /etc/locale.conf results in:

cat /etc/locale.conf 
─────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     β”‚ File: /etc/locale.conf
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 β”‚ LANG=en_CA.UTF-8
─────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Avenues of Research in an attempt to solve the problem include:

  • General internet searching with keywords of the issue through any forums available
  • Reviewing other forum posts in this forum.
  • However, all other posters of the issue I am having are running KDE Plasma, and I am running MATE. The β€œrc” file that was causing the override does not exist for me.

Any help would be appreciated. Let me know if there is anything needed further to help diagnose this.

Thanks, Jaymo

YaST will facilitate system-wide changes, but your user session in the desktop environment is probably overriding that.

Show systemctl --user show-environment | grep LANG

Compare it with the system-wide settings
sudo systemctl show-environment | grep LANG
or
localectl

To set it persistently for a user, create ~/config/enviroment.d/ with mkdir ~/.config/environment.d, then nano ~/.config/environment.d/locale.conf, and add LANG=en_CA.UTF-8. Save when done, and it should take effect when you next login to MATE.

1 Like

BTW, I’m not a MATE user, but I assume you investigated the β€œLanguage and Region” configuration utility via the desktop system preferences menu?

Never used MATE too. However if I wanted to use it I would rely on this query:

https://share.google/aimode/ZZFmauelAtjIuaGhi

Which I already hinted at in my last post. :wink:

User environment:

systemctl --user show-environment | grep LANG
LANG=en_US.utf8
GDM_LANG=en_US.utf8

System environment:

sudo systemctl show-environment | grep LANG
[sudo] password for root: 
LANG=en_CA.UTF-8

Thank you for the assistance. Unfortunately, this did not work as after rebooting the machine it presented with the same user locale configuration of en_US.

cat ~/.config/environment.d/locale.conf 
─────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     β”‚ File: /home/jadams/.config/environment.d/locale.conf
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 β”‚ LANG=en_CA.UTF-8
─────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

I looked for this too in the MATE control centre. In the previous distributions I have used, Ubuntu MATE and Debian with MATE, there was a language and region module that could be used to change the system and user language and number/date formatting to English (Canada). This does not appear to be present in openSUSE Tumbleweed MATE, so I thought that this is done through YaST instead.

I appreciate everyone’s help as I work through some of the differences I need to learn in openSUSE Tumbleweed compared to Ubuntu and Debian based distributions.

Jaymo

UPDATE:

After some further internet searches, I tried doing the following:

systemctl --user set-environment LANG=en_CA.utf8
systemctl --user set-environment GDM_LANG=en_CA.utf8

Which correctly set my user locale to en_CA.

However, after rebooting, the user locale was reset to en_US.

I just tried setting a locale for my user in the .bashrc and that seems to work.

So, edit the .bashrc in your user’s home directory e.g. with

nano  ~/.bashrc

and add the line

export LANG="en_CA.UTF-8"

Then log out and log in again. After that

locale

should show the desired localisation and it should be reboot persistant

Hi @DuctTape,

Thanks for the advice. I actually ran into some other random issues on my install and decided to reinstall and give KDE Plasma a try.

I was able to set the Date & Time to Canadian English in the Plasma settings and generally things seem to work smoother on Plasma. Maybe MATE is not a well-supported desktop environment on openSUSE Tumbleweed.

I appreciate it, and apologies for wasting your time. This is good to know if I have locale issues going forward.

Jaymo

No worries, if I wouldn’t want my time to be wasted, I wouldn’t have answered :wink:

Nice that it works now.

1 Like

My understanding is that ~/.bashrc is read by interactive shells, and this may be sufficient for the OP’s use case, but GUI apps may behave differently. Does it work for things such as the panel clock, and file manager?

Did you not find a β€œLanguage Support” GUI?

Unfortunately not, I even did a search in the MATE Control Centre and I couldn’t find one.

I had to reinstall due to some other, β€œpapercut” style issues I ran into and decided to go with KDE Plasma on the fresh install. New year, new DE, and I want to transition to Wayland.

I was able to get the locale sorted out using Plasma’s settings and could set the date and time, among other things, to Canadian English standard.

I appreciate the help.

1 Like

When I was on MATE, the panel clock showed US English date/time format and I had not checked the file manager, Caja. However, by the time @DuctTape provided me with the .bashrc solution, I had reinstalled openSUSE Tumbleweed with the KDE Plasma desktop.

I had to check it again to verify. Yes it does change the locale for the user also in GUI apps, file manager, notifications, etc.

1 Like

It makes me wonder if you were missing one of the MATE components?

In an Ubuntu thread I saw a reference to gnome-language-selector…

Anyway, as you are now using KDE Plasma this is moot.

1 Like

I was thinking this too. However, I installed MATE initially from the installer so I figured it would include all the desktop-related packages I would require.

I previously used Ubuntu MATE before switching to Tumbleweed, so I was expecting a similar language/region tool, but perhaps it was Ubuntu MATE specific.

KDE Plasma is going really well. I am led to believe that this is the β€œprimary” desktop experience for openSUSE Tumbleweed. I was not necessarily tied to MATE - it was what I have been used to over the past while of using MATE on Ubuntu MATE and Debian.

Off-topic, but good choice IMNSHO. :slight_smile:

1 Like

True, apologies for carrying on.

As this was my first topic in the openSUSE forum, I’m not sure if I should mark anything as β€œsolved” as my solution was to reinstall with a different DE. I want to make sure I’m doing things in line with what the community expects.

You can mark the post which you consider β€œsolved” the issue, or leave it unsolved if only a β€œworkaround”. The topic will self-close with inactivity.

1 Like

You can actually mark your own Reply (the reinstall different DE post) as Solved, if that is the solution for you :+1:

1 Like