Reset QLocale internals when we have a custom app language
ClosedPublic

Authored by aacid on Feb 23 2018, 12:34 AM.

Diff Detail

Repository
R263 KXmlGui
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aacid created this revision.Feb 23 2018, 12:34 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 23 2018, 12:34 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
aacid requested review of this revision.Feb 23 2018, 12:34 AM
apol accepted this revision.Feb 23 2018, 11:32 AM
apol added a subscriber: apol.

+1

Looks messy, should we look into getting it in Qt?

This revision is now accepted and ready to land.Feb 23 2018, 11:32 AM
aacid updated this revision to Diff 27886.Feb 23 2018, 11:47 PM
aacid retitled this revision from Set QLocale too when we have a custom app language to Reset QLocale internals when we have a custom app language.
aacid removed a subscriber: apol.

Use QSystemLocale trick to reset QLocale

aacid added a subscriber: lueck.Feb 23 2018, 11:48 PM

@lueck can you try this new version *without* https://phabricator.kde.org/D10758 and https://phabricator.kde.org/D10759 ? This should be enough to get QLocale to update itself.

apol added inline comments.Feb 24 2018, 12:32 AM
src/kswitchlanguagedialog_p.cpp
99

Not saying this is good or bad but clearly looks like Qt is missing some API there.

aacid added inline comments.Feb 24 2018, 12:38 AM
src/kswitchlanguagedialog_p.cpp
99

I don't know, the problem as far as i see it is that we're trying to do this in a generic way, a regular app would just setenv before doing anything Qt related, but we can't do that, if you go to Qt and ask for a "reread locale" i'm pretty sure they're going to say "you're doing it wrong", and honestly i'm not sure i want to take that battle :D

lueck added a comment.Feb 24 2018, 9:56 AM

@lueck can you try this new version *without* https://phabricator.kde.org/D10758 and https://phabricator.kde.org/D10759 ? This should be enough to get QLocale to update itself.

Done that.
D10757 without D10758 + D10759 fixes the bug reported in https://bugs.kde.org/show_bug.cgi?id=390623
Thanks

aacid updated this revision to Diff 28076.Feb 25 2018, 11:58 PM

Now includes an auto test.

It's not amazing since it doesn't totally reproduce the real world scenario but should be close enough.

Had to make two functions be exported but since the header is not installed and it's on the KDEPrivate namespace we should be fine

apol added a comment.Feb 26 2018, 12:25 AM

Go for it +1

I'd still try to add the needed API in Qt though.

This revision was automatically updated to reflect the committed changes.