Locale settings in Plasma Next

John Layt jlayt at kde.org
Tue May 6 18:42:32 UTC 2014


On 5 May 2014 15:44, Sebastian Kügler <sebas at kde.org> wrote:
> On Sunday, February 23, 2014 20:10:31 John Layt wrote:
>> One question is when these changes to the envvars will get applied, and the
>> action required to apply them to the apps.  I believe Gnome forces you to
>> log out and in again before the new envvars are applied.  In KDE4 you could
>> simply restart individual apps, but to update Plasma itself you had to log
>> out and in.  Do we update the envars as soon as the KCM changes are saved,
>> which would allow apps to simply be restarted, or would that be considered
>> dangerous for running apps that assume the envvars won't change, e.g. would
>> something like glibc immediately pick up the change and return inconsistent
>> results?
>
> I'd say let's try writing out the envvars immediately, we'll see soon enough
> if things break. (Which to me would be application-level bugs, but if they're
> too bad, we might want to indirected the setting.)
>
> John, you said that you started splitting the locale KCM already, is that work
> already available somewhere? I could put some time into trying to get it up to
> scratch for an initial release. (To me, right now, even disabling the locale
> KCM altogether is better than keeping it as-is.)

I started, basically I copied the existing kcm to a new one in
kcontrol/translations and deleted all the KLocale format code, leaving
just the languages tab, I've mostly been experimenting with layout
options.  I hadn't started the new Formats kcm yet.  Basically feel
free to do what you like, I'd say disable or delete the existing one,
and we can add new ones as clean code whenever we get to them.

If you want to do something, I'd suggest looking at startkde, or
whatever it is that starts Plasma up, and modify it to export the
locale envvars if set by the kcm (LC_NUMERIC, LC_TIME, LC_MONETARY,
LC_MESSAGES, LC_MEASUREMENT, LC_COLLATE, LC_CTYPE, LANGUAGE and LANG,
but *not* LC_ALL).  You'll need first to decide in what config file
these get saved, just remember that it's a Plasma specific setting,
not a general KDE Frameworks or Apps setting.

After that it should be easy enough to do a temporary Formats kcm with
some combo boxes populated with locales using
QLocale::matchingLocales().  There would be one combo for "Default
Format" which defaults to "System Locale" (i.e. don't override
anything) and populates LANG if a different locale is chosen.  The
other combos would be for example "Number Format" which defaults to
"Default Format" (i.e. don't override anything).  Don't offer
LC_MESSAGES here, I think that should be set by the Translations KCM.

Cheers!

John.


More information about the Plasma-devel mailing list