Bug 470695

Summary: Invalid Plasma<->GLibc locale matching heuristic
Product: [Applications] systemsettings Reporter: jekhor <jekhor>
Component: kcm_regionandlangAssignee: Joshua Goins <josh>
Status: ASSIGNED ---    
Severity: normal CC: hanyoung, josh, kde, nate
Priority: NOR    
Version First Reported In: 6.3.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=399283
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description jekhor@gmail.com 2023-06-06 08:29:51 UTC
SUMMARY
***
The Region and Language KCM has a strange heuristic for mapping Plasma language to GLibc locale in the KCMRegionAndLang::constructGlibcLocaleMap(). This algorithm can select almost unused locale variant instead of expected one. For example, it selects a be_BY@latin locale for Belarusian language instead of pure be_BY.
***

STEPS TO REPRODUCE
1. Run Region and Language KCM
2. Select a Belarusian ("беларуская") language
3. Apply changes
4. Check the ~/.config/plasma-localerc for LANG variable

OBSERVED RESULT
LANG=be_BY.UTF-8@latin

EXPECTED RESULT
LANG=be_BY.UTF-8

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
Operating System: Debian GNU/Linux 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-9-amd64 (64-bit)
Graphics Platform: X11
Comment 1 Joshua Goins 2023-06-07 23:23:07 UTC
Can confirm, we should have a better heuristic in this case. Thanks for pointing out the specific function that's the issue too!
Comment 2 David Edmundson 2024-09-18 08:48:00 UTC
I tested the equivalent on Gnome. They list both

Belarus
Belarus - Latin

Which seems easier and more transparent than trying to do some magic behind the scenes
Comment 3 jekhor@gmail.com 2025-02-17 15:40:55 UTC
Reproduces in Plasma 6.3