DigitalClock: Use correct language for month and day names
Needs RevisionPublic

Authored by drosca on Apr 8 2017, 8:57 AM.

Details

Reviewers
mck182
davidedmundson
Group Reviewers
Plasma
Summary

Same as D5345

Test Plan

I have English ui language + Czech time format. Months and days are now in English and not Czech.

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
drosca created this revision.Apr 8 2017, 8:57 AM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 8 2017, 8:57 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mck182 accepted this revision.Apr 11 2017, 2:57 AM

Same as the other diff, if safe, good to go.

EDIT: I feel like we could wrap the Qt.locale(Qt.locale().uiLanguages[0]) into something shorter, maybe.
Possibly also keep it instantiated around.

This revision is now accepted and ready to land.Apr 11 2017, 2:57 AM
drosca updated this revision to Diff 13343.Apr 12 2017, 8:06 AM

Make uiLocale as property + fix language in tooltip

drosca updated this revision to Diff 13345.Apr 12 2017, 8:50 AM

Also fix language in compact representation when Long Date is configured

drosca updated this revision to Diff 13394.Apr 13 2017, 4:38 PM

Use correct form (not standalone) of day/month names

ngraham added a subscriber: ngraham.Dec 5 2019, 9:12 PM

Is this still relevant?

The thing this fixes is there.

It's arguably a tiny bit less relevant as people might now use a custom date format in just the digital clock, instead of choosing a different locale for times.

FWIW, I submitted a change that did exactly this at the "correct" layer in Qt: https://codereview.qt-project.org/c/qt/qtbase/+/139295
This is doing the same thing but with a parsing layer before we do the parsing....which is both really clever and horrificly mad at the same time.

The solution won't work in all cases. For example:

QLocale(QLocale::Portuguese).dateFormat() = "dddd, d 'de' MMMM 'de' yyyy"

So with this, if I have English language with portuguese time locale I still get "Thursday, 29 de October de 2015". which is still wrong.

davidedmundson requested changes to this revision.Dec 5 2019, 9:34 PM

Marking as request changes to get it out my queue, as I think it needs more discussion after my comment above

I could be maybe persuaded, but adding a bad hack that only works for some situations doesn't seem like a good idea.

This revision now requires changes to proceed.Dec 5 2019, 9:34 PM