Merge Langauage and Formats KCM
Both Language and Formats KCM set $LANG
env. And we have some issues with Formats KCM. This is the issue that sum up all the to-dos, and we can discuss them here.
Formats
What doesn't work
Examples
-
Currently, examples is a trailing component in Kirigami.BasicListItem. While this works perfectly fine on desktop, on PinePhone the trailing overlaps with the item title. There isn't enough space for long examples like date/time format. We need to figure out another way to display examples.
Not all env is settable
-
We only have Lang
Measurement
Time
Number
Monementary
, POSIX defines a wider range of envs, we should support them. The only problem is withLC_COLLATE
because the difficulty of how can we display its example.
The locale list is ICU locale list
-
On Unicode charset, ICU locales is a superset of Glibc locales. Valid ICU locales may be invalid Glibc locale, which will lead to programs that use gettext
complains about invalid locale. We should only let user choose POSIX locales. However, Glibc does support other charsets, which ICU doesn't. But ICU accepts locale with other charset, it will pick the Unicode version of that locale. No problem here.
We can't generate the Glibc locale
-
Glibc locale needs to be generated first. Which requires root permission. There is a systemd-localed DBus methods can do that, but we don't explicitly depends on systemd. Besides, on some distributions, we need to install the corresponding langauge package first. I can't come up with a universal solution to this. So maybe we can display a message with link to "how to generate locale on various distributions" like webpage?
Language
-
Haven't looked into the code yet. IIRC @ngraham said we should just copy the existing UI into a subpage of Formats and set LC_MESSAGE
according to the language hierarchy?
Locale Installation/Generation
-
Ubuntu We can check 'check-language-support' to determine if it's an Ubuntu based distro, old KCM compare name http://manpages.ubuntu.com/manpages/trusty/man1/check-language-support.1.html + PackageKit Already supported in Language KCM, copy the code over. -
Other glibc distro edit /etc/locale.gen
, call locale-gen, help message to info manual font installation we have to edit/etc/locale.gen
, since distro like Arch runlocale-gen
every time.locale-gen
purge locales not enabled inlocale.gen
-
None systemd/musl distro musl uses musl-locale, can't automate any part of it, display message
Related:
Edited by Ghost User