Bug 416670

Summary: Date/Time locale settings not respected in plasma 5.18 beta
Product: [Plasma] plasmashell Reporter: Robby Engelmann <robby.engelmann>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, plasma-bugs-null, robby.engelmann, wbauer1
Priority: NOR    
Version First Reported In: 5.17.90   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.18.0
Sentry Crash Report:
Attachments: shot1 settings
AM and PM shown in Korganizer, it should be 24h format
clock
env result

Description Robby Engelmann 2020-01-23 22:47:39 UTC
Created attachment 125351 [details]
shot1 settings

SUMMARY
After the update from plasma 5.17.5 to 5.17.90, the locale settings for date/time are not correctly taken. They are set to de_de, however, the digital clock, the time column in Korganizer and the date/time on the lock-screen show I would say the en_US setting.
Please find attached some screenshots showing the format settings and the result. Using plasma 5.17.5 the date/time format for de_de was shown correctly in digital clock, Korganizer and Lock-Screen.

I am using an up-to-date openSUSE Tumbleweed system with the frameworks-repo activated. (Qt 5.14, Frameworks 5.66)
Comment 1 Robby Engelmann 2020-01-23 22:48:24 UTC
Created attachment 125352 [details]
AM and PM shown in Korganizer, it should be 24h format
Comment 2 Robby Engelmann 2020-01-23 22:48:44 UTC
Created attachment 125353 [details]
clock
Comment 3 David Edmundson 2020-01-24 00:00:48 UTC
Please include output of "env"
Comment 4 Robby Engelmann 2020-01-24 08:00:24 UTC
Created attachment 125358 [details]
env result
Comment 5 Robby Engelmann 2020-01-24 08:00:42 UTC
(In reply to David Edmundson from comment #3)
> Please include output of "env"

DONE
Comment 6 Kai Uwe Broulik 2020-01-24 09:23:08 UTC
Looks like you're missing `LC_TIME`
Comment 7 Robby Engelmann 2020-01-24 10:28:50 UTC
However, it worked correctly with Plasma 5.17.5.
Comment 8 Wolfgang Bauer 2020-01-29 09:16:02 UTC
(In reply to Kai Uwe Broulik from comment #6)
> Looks like you're missing `LC_TIME`
AFAICS, startplasma doesn't handle LC_TIME...

void runStartupConfig()
{
    //export LC_* variables set by kcmshell5 formats into environment
    //so it can be picked up by QLocale and friends.
    KConfig config(QStringLiteral("plasma-localerc"));
    KConfigGroup formatsConfig = KConfigGroup(&config, "Formats");

    const auto lcValues = {
        "LANG", "LC_NUMERIC", "LC_MONETARY", "LC_MEASUREMENT", "LC_COLLATE", "LC_CTYPE"
    };
    for (auto lc : lcValues) {
        const QString value = formatsConfig.readEntry(lc, QString());
        if (!value.isEmpty()) {
            qputenv(lc, value.toUtf8());
        }
    }
(https://cgit.kde.org/plasma-workspace.git/tree/startkde/startplasma.cpp)
Comment 9 Wolfgang Bauer 2020-01-29 09:18:47 UTC
That's apparently a regression in https://cgit.kde.org/plasma-workspace.git/commit/?id=26284d73cf94e469592e65bc17da01248db42168 .
Comment 10 Kai Uwe Broulik 2020-01-29 09:23:36 UTC
Thanks for your analysis. Does this help? https://phabricator.kde.org/D26981
Comment 11 Kai Uwe Broulik 2020-01-29 09:30:30 UTC
Git commit bc34f232b7cdd67d81e3e66709811876b6d6707b by Kai Uwe Broulik.
Committed on 29/01/2020 at 09:29.
Pushed by broulik into branch 'Plasma/5.18'.

[startkde] Export LC_TIME again
FIXED-IN: 5.18.0

Differential Revision: https://phabricator.kde.org/D26981

M  +1    -1    startkde/startplasma.cpp

https://commits.kde.org/plasma-workspace/bc34f232b7cdd67d81e3e66709811876b6d6707b