Bug 431292

Summary: Language KCM should install language-pack-${LANG} and then run "sudo apt install `check-language-support`" on debian-based distro to complete language support
Product: [Applications] systemsettings Reporter: soredake <katyaberezyaka>
Component: kcm_languageAssignee: Eike Hein <hein>
Status: RESOLVED FIXED    
Severity: wishlist CC: katyaberezyaka, kde, nate, plasma-bugs, postix, rdieter, sitter
Priority: NOR    
Version: 5.19.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=384451
https://bugs.kde.org/show_bug.cgi?id=455217
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description soredake 2021-01-08 08:43:16 UTC
SUMMARY
check-language-support on ubuntu will install missing languages/dictionaries for selected language/format.

STEPS TO REPRODUCE
1. Got formats/language kcm.
2. Change language.
3. No `check-language-support` is run after selecting another language/format.

OBSERVED RESULT
No `check-language-support` is run after selecting another language/format.

EXPECTED RESULT
`check-language-support` is run after selecting another language/format.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 20.10
(available in About System)
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Comment 1 soredake 2021-01-08 08:45:22 UTC
Gnome doing this already https://launchpadlibrarian.net/345780979/Language%20Support%20Not%20Installed.png
Comment 2 soredake 2021-01-09 09:46:06 UTC
https://bugs.launchpad.net/ubuntu/+source/language-selector/+bug/1910692/comments/3

As i know now, check-language-support relies on language-pack-${LANG} package to install missing languages for apps, so after user switches language kde needs to do two things:

1. install package language-pack-${LANG} to selected by user language
2. ask to run check-language-support to actually install missing language packs for apps
Comment 3 soredake 2021-01-09 09:46:35 UTC
And locales for selected language needs to be generated, too.
Comment 4 soredake 2021-01-09 09:47:47 UTC
For locales there are report https://bugs.kde.org/show_bug.cgi?id=384451
Comment 5 soredake 2021-01-09 10:01:30 UTC
Actually, kcm does not need to generate locales, to generate locales it only needs to pull language-pack-ru, which itself pulls language-pack-ru-base, which itself generates locales in postinst using "/usr/share/locales/install-language-pack" command
Comment 6 soredake 2021-01-09 10:08:58 UTC
Gnome has utility to to all of this (installing language-pack-${LANG}, and running `check-language-support`), https://packages.ubuntu.com/groovy/language-selector-gnome
Comment 7 David Edmundson 2021-01-09 18:02:28 UTC
Can you provide an upstream link of where "check-language-support" comes from?
And what bug this solves
Comment 8 soredake 2021-01-10 08:58:56 UTC
https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/language-selector

For example, initially my system was set to english, and now i'm switching language/locales to ukrainian, this creates two problems:

1. locales for selected formats/language is not generated, which causes LC_* env to fallback to 
"C.UTF-8" which creates problems like ark not opening archives correctly and other bugs, see https://bugs.kde.org/show_bug.cgi?id=384451 https://bugs.kde.org/show_bug.cgi?id=430803
2. language packs and dictionaries (you can see it if you run `check-language-support --show-installed`) such as "firefox-locale-uk gimp-help-uk hunspell-uk and other" are not installed, leaving user with incomplete language support after switching.

Installing `language-pack-${LANG}` after switching to corresponding language will fix problem one as this package generates locales, and user will have properly translated (instead of C.UTF-8) and working system (no ark problems or crashes related to C.UTF-8).

Running `check-language-support` after switch to another language will install missing language packs and dictionaries.

As you see, these two things can fix problems and make users happy, including me, who faced problems after switching language and locales.
Comment 9 Bug Janitor Service 2021-01-25 04:33:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 soredake 2021-01-25 13:13:40 UTC
I provided needed info.
Comment 11 soredake 2021-04-30 13:33:26 UTC
Fedora has similar package https://pagure.io/system-config-language
Comment 12 Harald Sitter 2021-05-03 11:45:07 UTC
Related: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/560

I'm not quite sure how the Formats KCM factors into this though.

It doesn't really need language-support, what it needs is locale definitions and I believe those only need compiling via locale-gen (which in turn is simply a wrapper for localedef). Someone would need to do research how all this ought to __actually__ work. Like, currently the formats KCM models QLocale's locale list but I'm sure that internally relies on Qt's embedded locale data not the system's theoretically generatable ones (/usr/share/i18n/locales). Then the locales need generating if they don't already exist (locale -a). Once the locale is generated it'd need adding to some file in /etc presumably (locale.gen?)

https://man7.org/linux/man-pages/man1/locale.1.html
https://man7.org/linux/man-pages/man1/localedef.1.html
https://www.unix.com/man-page/linux/8/locale-gen/
https://wiki.archlinux.org/title/locale
https://github.com/systemd/systemd/blob/5efbd0bf897a990ebe43d7dc69141d87c404ac9a/src/locale/localed.c#L440

From glancing over the documention I don't expect the formats KCM needs distro specific code at all, it just needs to actually wire into the system-level locale infrastructure properly via a privileged kauth helper.
Comment 13 Nate Graham 2021-09-30 17:52:54 UTC
*** Bug 430803 has been marked as a duplicate of this bug. ***
Comment 14 hanyoung 2022-07-02 09:30:51 UTC
Git commit 134e2d5c989c36ac0e985ee0ae382996c6b7b56e by Han Young.
Committed on 02/07/2022 at 09:29.
Pushed by hanyoung into branch 'master'.

merge Language and Formats
Related: bug 192019, bug 341235, bug 344588, bug 394477, bug 397974, bug 397975, bug 403580, bug 417564, bug 420268, bug 429474, bug 444772, bug 446785, bug 447787, bug 448324, bug 448355, bug 451919, bug 451944, bug 454991

closes https://invent.kde.org/plasma/plasma-workspace/-/issues/23

M  +1    -0    .kde-ci.yml
M  +52   -8    CMakeLists.txt
M  +2    -1    config-workspace.h.cmake
D  +0    -2    doc/kcontrol/formats/CMakeLists.txt
D  +0    -63   doc/kcontrol/formats/index.docbook
R  +1    -1    doc/kcontrol/region_language/CMakeLists.txt [from: doc/kcontrol/translations/CMakeLists.txt - 063% similarity]
R  +-    --    doc/kcontrol/region_language/go-top.png [from: doc/kcontrol/translations/go-top.png - 100% similarity]
R  +36   -23   doc/kcontrol/region_language/index.docbook [from: doc/kcontrol/translations/index.docbook - 050% similarity]
A  +-    --    doc/kcontrol/region_language/list-remove.png
D  +-    --    doc/kcontrol/translations/list-remove.png
M  +1    -2    kcms/CMakeLists.txt
D  +0    -30   kcms/formats/CMakeLists.txt
D  +0    -5    kcms/formats/Messages.sh
D  +0    -61   kcms/formats/formatssettings.kcfg
D  +0    -80   kcms/formats/kcmformats.cpp
D  +0    -34   kcms/formats/kcmformats.h
D  +0    -183  kcms/formats/localelistmodel.cpp
D  +0    -140  kcms/formats/optionsmodel.cpp
D  +0    -126  kcms/formats/package/contents/ui/main.qml
A  +75   -0    kcms/region_language/CMakeLists.txt
A  +8    -0    kcms/region_language/Messages.sh
R  +2    -27   kcms/region_language/exampleutility.cpp [from: kcms/formats/exampleutility.cpp - 052% similarity]
A  +22   -0    kcms/region_language/exampleutility.h     [License: GPL(v2.0+)]
A  +82   -0    kcms/region_language/kcm_regionandlang.desktop [TRAILING SPACE] ** [TRAILING SPACE] **
R  +4    -4    kcms/region_language/kcm_regionandlang.json [from: kcms/formats/kcm_formats.json - 098% similarity]
A  +250  -0    kcms/region_language/kcmregionandlang.cpp     [License: GPL(v2.0+)]
A  +58   -0    kcms/region_language/kcmregionandlang.h     [License: GPL(v2.0+)]
A  +372  -0    kcms/region_language/languagelistmodel.cpp     [License: GPL(v2.0+)]
A  +100  -0    kcms/region_language/languagelistmodel.h     [License: GPL(v2.0+)]
A  +30   -0    kcms/region_language/localegenerator.cpp     [License: LGPL(v2.0+)]
A  +17   -0    kcms/region_language/localegenerator.h     [License: LGPL(v2.0+)]
A  +19   -0    kcms/region_language/localegeneratorbase.cpp     [License: GPL(v2.0+)]
A  +23   -0    kcms/region_language/localegeneratorbase.h     [License: GPL(v2.0+)]
A  +32   -0    kcms/region_language/localegeneratorglibc.cpp     [License: GPL(v2.0+)]
A  +24   -0    kcms/region_language/localegeneratorglibc.h     [License: GPL(v2.0+)]
A  +101  -0    kcms/region_language/localegeneratorubuntu.cpp     [License: GPL(v2.0+)]
A  +27   -0    kcms/region_language/localegeneratorubuntu.h     [License: GPL(v2.0+)]
A  +36   -0    kcms/region_language/localegenhelper/CMakeLists.txt
A  +187  -0    kcms/region_language/localegenhelper/localegenhelper.cpp     [License: GPL(v2.0+)]
A  +46   -0    kcms/region_language/localegenhelper/localegenhelper.h     [License: GPL(v2.0+)]
A  +20   -0    kcms/region_language/localegenhelper/org.kde.localegenhelper.conf
A  +21   -0    kcms/region_language/localegenhelper/org.kde.localegenhelper.policy
A  +8    -0    kcms/region_language/localegenhelper/org.kde.localegenhelper.service.in
A  +158  -0    kcms/region_language/localelistmodel.cpp     [License: GPL (v2+)]
R  +22   -22   kcms/region_language/localelistmodel.h [from: kcms/formats/localelistmodel.h - 060% similarity]
A  +197  -0    kcms/region_language/optionsmodel.cpp     [License: GPL(v2.0+)]
R  +21   -11   kcms/region_language/optionsmodel.h [from: kcms/formats/optionsmodel.h - 054% similarity]
A  +204  -0    kcms/region_language/package/contents/ui/AdvancedLanguageSelectPage.qml     [License: LGPL(v3.0+)]
A  +238  -0    kcms/region_language/package/contents/ui/main.qml     [License: LGPL(v3.0+)]
A  +64   -0    kcms/region_language/regionandlangsettings.cpp     [License: GPL(v2.0+)]
A  +21   -0    kcms/region_language/regionandlangsettings.h     [License: GPL(v2.0+)]
A  +37   -0    kcms/region_language/regionandlangsettingsbase.kcfg
R  +2    -2    kcms/region_language/regionandlangsettingsbase.kcfgc [from: kcms/formats/formatssettings.kcfgc - 055% similarity]
A  +17   -0    kcms/region_language/settingtype.h     [License: GPL(v2.0+)]
D  +0    -49   kcms/translations/CMakeLists.txt
D  +0    -2    kcms/translations/Messages.sh
D  +0    -191  kcms/translations/language.cpp
D  +0    -32   kcms/translations/language.h
D  +0    -312  kcms/translations/package/contents/ui/main.qml
D  +0    -86   kcms/translations/translations.cpp
D  +0    -53   kcms/translations/translations.h
D  +0    -193  kcms/translations/translationsmodel.cpp
D  +0    -72   kcms/translations/translationsmodel.h
D  +0    -27   kcms/translations/translationssettings.cpp
D  +0    -24   kcms/translations/translationssettings.h
D  +0    -28   kcms/translations/translationssettingsbase.kcfg
D  +0    -6    kcms/translations/translationssettingsbase.kcfgc

The files marked with ** at the end have a problem. Either the file contains a trailing space or the file contains a call to potentially dangerous code. Please read: https://community.kde.org/Sysadmin/CommitHooks#Email_notifications for further information. Please either fix the trailing space or review the dangerous code.


https://invent.kde.org/plasma/plasma-workspace/commit/134e2d5c989c36ac0e985ee0ae382996c6b7b56e