Bug 464983 - Disabling glibc locale-gen has side effect on `~/.config/plasma-localerc`
Summary: Disabling glibc locale-gen has side effect on `~/.config/plasma-localerc`
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_regionandlang (show other bugs)
Version: 5.26.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-29 14:29 UTC by lakesarchive
Modified: 2023-02-27 08:02 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.1


Attachments
Locale has been configured, but this KCM currently does not support auto locale generation on non-glibc systems, please refer to your distribution's manual to install fonts and generate locales (186.45 KB, image/png)
2023-01-29 14:29 UTC, lakesarchive
Details
See how it's still "American English" but the UI language is already "Chinese" (the font is incorrect) (200.87 KB, image/png)
2023-01-29 14:31 UTC, lakesarchive
Details
The Chinese are preferred however, not "American English". (148.00 KB, image/png)
2023-01-29 14:32 UTC, lakesarchive
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lakesarchive 2023-01-29 14:29:57 UTC
Created attachment 155761 [details]
Locale has been configured, but this KCM currently does not support auto locale generation on non-glibc systems, please refer to your distribution's manual to install fonts and generate locales

SUMMARY
Since this month (or the previous month maybe?) there are complaints on Arch Linux CN's BBSes that "they cannot configure the locale to Chinese", and they mentioned this error. Though the specific post is a misinterpretation, this error still doesn't make sense at all (because Arch Linux do use glibc). I tried a fresh install of Arch Linux and the problem remains.

Along with the above phenomenon, because under TTY, Chinese cannot be displayed, basically all users write `LANG=en_US.UTF-8` in `/etc/locale.conf` and specify Chinese locale in their home directory or through the KDE system setting. However in the above fresh install, after setting locale to Chinese in KDE settings, in the generated file `~/.config/plasma-localerc`, the `LANG=` under `[Formats]` section isn't Chinese (my case `zh_CN.UTF-8`) but still English (`en_US.UTF-8`) while `LANGUAGE=` under `[Translations]` has `zh-CN` as the first language, causing the locale setting to show selected "English" outside the advanced language selection page but inside the page Chinese is preferred, also causing all formats and fonts to behave abnormal (for font, it's using Japanese font instead of Chinese font).

STEPS TO REPRODUCE
1. Fresh install an Arch Linux without `testing` repositories (and its alke) enabled, install `plasma`, `kde-applications-meta`, `noto-fonts-cjk` and packages needed, create a user under `wheel` group, enable sudoers for them, uncomment languages (Chinese and English) `/etc/locale.gen` , specify `LANG=en_US.UTF-8` in `/etc/locale.conf`, run `locale-gen`, enable sddm, reboot
2. Login, add Chinese (Simplified) (`简体中文`) as the first language in system settings
3. Reboot

OBSERVED RESULT
After setting the language, it complains "Locale has been configured, but this KCM currently does not support auto locale generation on non-glibc systems, please refer to your distribution's manual to install fonts and generate locales" and prompts "Changes will take effect the next time you log in." Then after reboot, though it changes to Chinese after logging in, the format and interface font isn't Chinese at all. Opening `systemsettings` through console doesn't provide any errors related to setting locale.

EXPECTED RESULT
After setting the language, it prompts "Changes will take effect the next time you log in.", and after reboot, the format, UI language and font are all as preferred.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (rolling) / KDE Plasma 5.26.5
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Comment 1 lakesarchive 2023-01-29 14:31:20 UTC
Created attachment 155762 [details]
See how it's still "American English" but the UI language is already "Chinese" (the font is incorrect)
Comment 2 lakesarchive 2023-01-29 14:32:12 UTC
Created attachment 155764 [details]
The Chinese are preferred however, not "American English".
Comment 3 lakesarchive 2023-01-29 16:09:32 UTC
Seems like that the packager of Arch Linux turned off glibc locale-gen on purpose. https://github.com/archlinux/svntogit-packages/commit/2f2b1e3c683d489e946afacd08cea0aeda1ec15c
But still, the message is confusing, which may mislead users that "something is wrong with the glibc package". I would say consider rewrite the message.
Comment 4 lakesarchive 2023-01-29 16:56:03 UTC
I changed the issue's title. After repackaging the package without the disabling flag, things get normal, however the `[Formats]` section should, I think, be the same as the first preferred language by default.
Comment 5 lakesarchive 2023-01-29 16:56:40 UTC
(In reply to lakesarchive from comment #4)
> I changed the issue's title. After repackaging the package without the
> disabling flag, things get normal, however the `[Formats]` section should, I
> think, be the same as the first preferred language by default.

...by default, even when the glibc support is dropped during compiling.
Comment 6 Bug Janitor Service 2023-01-30 12:34:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2565
Comment 8 hanyoung 2023-02-27 08:00:54 UTC
Git commit 889e414279e519b7cb444445b493d0eb1865baf2 by Han Young, on behalf of Ghost User.
Committed on 10/02/2023 at 15:45.
Pushed by hanyoung into branch 'master'.

set LANG if we have language to glibc locale mapping

Instead of relying on build options like `GLIBC_LOCALE_GEN`, we set LANG if we have language to locale code mapping. Also change the definition of unsupported language from "whatever language we don't have locale mapping" to "languages not in plasmashell i18n scope"

M  +6    -13   kcms/region_language/kcmregionandlang.cpp
M  +2    -1    kcms/region_language/kcmregionandlang.h
M  +17   -6    kcms/region_language/languagelistmodel.cpp
M  +3    -1    kcms/region_language/languagelistmodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/889e414279e519b7cb444445b493d0eb1865baf2
Comment 9 hanyoung 2023-02-27 08:01:16 UTC
Git commit bd90d2b3cf28a53e2e27841b8b05f5b5ff99471e by Han Young, on behalf of Ghost User.
Committed on 15/02/2023 at 04:20.
Pushed by hanyoung into branch 'Plasma/5.27'.

set LANG if we have language to glibc locale mapping

Instead of relying on build options like `GLIBC_LOCALE_GEN`, we set LANG if we have language to locale code mapping. Also change the definition of unsupported language from "whatever language we don't have locale mapping" to "languages not in plasmashell i18n scope"


(cherry picked from commit 889e414279e519b7cb444445b493d0eb1865baf2)

M  +6    -13   kcms/region_language/kcmregionandlang.cpp
M  +2    -1    kcms/region_language/kcmregionandlang.h
M  +17   -6    kcms/region_language/languagelistmodel.cpp
M  +3    -1    kcms/region_language/languagelistmodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/bd90d2b3cf28a53e2e27841b8b05f5b5ff99471e
Comment 10 hanyoung 2023-02-27 08:02:38 UTC
Git commit 0fc6e5b3d5b5c0392ba94e10fa5b6c880f6f9eb7 by Han Young, on behalf of Ghost User.
Committed on 10/02/2023 at 15:46.
Pushed by hanyoung into branch 'cherry-pick-889e4142'.

set LANG if we have language to glibc locale mapping

Instead of relying on build options like `GLIBC_LOCALE_GEN`, we set LANG if we have language to locale code mapping. Also change the definition of unsupported language from "whatever language we don't have locale mapping" to "languages not in plasmashell i18n scope"


(cherry picked from commit 889e414279e519b7cb444445b493d0eb1865baf2)

M  +6    -13   kcms/region_language/kcmregionandlang.cpp
M  +2    -1    kcms/region_language/kcmregionandlang.h
M  +17   -6    kcms/region_language/languagelistmodel.cpp
M  +3    -1    kcms/region_language/languagelistmodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/0fc6e5b3d5b5c0392ba94e10fa5b6c880f6f9eb7