Bug 513805 - Error from `locale` after switching time or number setting in Regional Settings
Summary: Error from `locale` after switching time or number setting in Regional Settings
Status: NEEDSINFO WAITINGFORINFO
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_regionandlang (other bugs)
Version First Reported In: 6.5.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-25 15:15 UTC by Peter Lemken
Modified: 2025-12-31 09:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Lemken 2025-12-25 15:15:51 UTC
Steps to Reproduce:

    Install KDE Plasma on Fedora (or any glibc-based distribution)
    Check available locales: locale -a | grep UTF Result: Shows lowercase utf8 (e.g., en_US.utf8, de_AT.utf8)
    Open System Settings → Regional Settings → Formats
    Change any format setting (e.g., currency or time format)
    Check ~/.config/plasma-localerc Result: Contains UTF-8 (uppercase with hyphen)
    Check /etc/locale.conf (gets overwritten via systemd-localed) Result: Also contains UTF-8 variants
    Run locale in terminal

Observed Result:

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_NUMERIC=de_AT.UTF-8
...

Locales fail to load because glibc only provides utf8 (lowercase, no hyphen) but KDE writes UTF-8 (uppercase, hyphen).

Expected Result: KDE should detect available locale names from locale -a and write the exact strings that the system provides, OR normalize to the system's naming convention.

Additional Information:

    Fedora 43, Plasma 6.5.4
    glibc generates locales as en_US.utf8 (lowercase, no hyphen)
    KDE writes en_US.UTF-8 to plasma-localerc
    When KDE triggers systemd-localed, it overwrites /etc/locale.conf with invalid names
    This affects all glibc-based distributions (Fedora, Arch, etc.)
    Debian works around this with symlinks in glibc

Proposed Solution: Query available locales with locale -a and only write locale names that actually exist on the system.
Comment 1 TraceyC 2025-12-29 23:14:51 UTC
Thanks for the bug report. Following these same steps, I don't see an error, using a system that has Plasma built from git-master
I have Language set to American English, and set time and numbers to de_AT

Note that all of the entries in /etc/locale.conf and ~/.config/plasma-localerc on my system for UTF-8 are in upper case, this seems normal. (This is the case on Solus as well as Fedora)

I also can't reproduce this on a Fedora 43 VM. Only American English was available by default, so I installed German under Language but that didn't make it available for Numbers, Time etc.

This seems like a potential issue with a system setting somewhere. I have some questions to narrow things down.

1. How were those locales installed on your system?
2. What is the full output of `locale` on your system?
3. Also, can you copy and paste the output of
printenv | grep -E '^(LANG|LC_)'

Thanks.
Comment 2 Peter Lemken 2025-12-30 12:49:04 UTC
(In reply to TraceyC from comment #1)
> Thanks for the bug report. Following these same steps, I don't see an error,
> using a system that has Plasma built from git-master
> I have Language set to American English, and set time and numbers to de_AT
> 
> Note that all of the entries in /etc/locale.conf and
> ~/.config/plasma-localerc on my system for UTF-8 are in upper case, this
> seems normal. (This is the case on Solus as well as Fedora)
> 
> I also can't reproduce this on a Fedora 43 VM. Only American English was
> available by default, so I installed German under Language but that didn't
> make it available for Numbers, Time etc.
> 
> This seems like a potential issue with a system setting somewhere. I have
> some questions to narrow things down.
> 
> 1. How were those locales installed on your system?
> 2. What is the full output of `locale` on your system?
> 3. Also, can you copy and paste the output of
> printenv | grep -E '^(LANG|LC_)'
> 
> Thanks.

It's a vanilla installation with all packages provided by Fedora 43.

locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE=en_US.utf8
LC_NUMERIC=en_AT.utf8
LC_TIME=de_AT.utf8
LC_COLLATE="en_US.utf8"
LC_MONETARY=de_AT.utf8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=de_AT.utf8
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT=de_AT.utf8
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

printenv | grep -E '^(LANG|LC_)'
LANGUAGE=
LC_MONETARY=de_AT.utf8
LC_PAPER=de_AT.utf8
LANG=en_US.utf8
LC_MESSAGES=en_US.UTF-8
LC_MEASUREMENT=de_AT.utf8
LC_CTYPE=en_US.utf8
LC_TIME=de_AT.utf8
LC_NUMERIC=en_AT.utf8

In Dolphin files that contain German Umlauts are displayed correctly, but not in Konsole eg. by calling ls ~/Documents the Umlauts are scrambled.
Comment 3 hanyoung 2025-12-30 13:43:22 UTC
Plasma shell loads locale settings from ~/.config/plasma-localerc. If this config is correct, then the lower case locale value comes from elsewhere. Possible in your shell setting? eg. ~/.zshrc
Comment 4 Peter Lemken 2025-12-30 22:26:34 UTC
cat ~/.config/plasma-localerc
[Formats]
LANG=en_US.utf8
LC_MEASUREMENT=de_AT.utf8
LC_MONETARY=de_AT.utf8
LC_NUMERIC=en_AT.utf8
LC_PAPER=de_AT.utf8
LC_TIME=de_AT.utf8

I use bash, so .zshrc doesn't even exist.
Comment 5 hanyoung 2025-12-31 09:42:06 UTC
https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html

UTF-8 suffix is correct according to glibc, if Fedora only supports .utf8, you can open an issue to Fedora project.