Bug 453292 - KOrganizer shows wrong month form in headers
Summary: KOrganizer shows wrong month form in headers
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: monthview (show other bugs)
Version: 5.20.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-02 11:58 UTC by Grzegorz Kulik
Modified: 2022-05-25 17:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The header in question (364.74 KB, image/png)
2022-05-02 11:58 UTC, Grzegorz Kulik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Kulik 2022-05-02 11:58:34 UTC
Created attachment 148513 [details]
The header in question

SUMMARY

Korganizer uses CLDR's "format" month form instead of "standalone" as the header of its month view (see attachment). In Slavic languages it makes the month name show in genitive case, which is correct only as a part of a full date, not as a calendar header.

STEPS TO REPRODUCE
1. Open KOrganizer
2. Click "Month" in the topbar.

OBSERVED RESULT

The month name in the calendar's header is in genitive.

EXPECTED RESULT

The month name should be in nominative.
Comment 1 gjditchfield 2022-05-04 01:34:01 UTC
KOrganizer uses the "month" form in many places which may be incorrect.
Could you tell me whether they should also be changed to "standalone"?

* In the Month view, the first and last days of each month have a month name,
but in a short form that may accidentally look correct.

* In the Agenda view, the column headers likewise use the short form.

* On the Recurrence tab of the incidence editor, if the event repeats yearly,
the month names in the "on" pull-down menu.

* If an event repeats yearly, the month names in the pop-up text that appears
when you hold the cursor over the event, and in the Item Viewer
(Settings > Sidebar > Show Item Viewer) when you select the event.

* File > Print Preview, then choose "Print month":  the month names in the
"Start month" and "End month" pull-down menus, and the month names in
the headers of the preview pages.

* File > Print Preview, then choose "Print year":  the month names in the
preview pages.

* File > Print Preview, then choose "Print week" and "Print as split week view":
 the month names in the headers of the preview pages.
Comment 2 Grzegorz Kulik 2022-05-05 17:28:06 UTC
I went on a hunt and I hope I caught all instances where the date is shown wrong:

- print day shows month name in the top left in "format" instead of "stand-alone",
- print event shows American date format if the event repeats every year,
- print month shows month names in "format" instead of "stand-alone" in all three instances,
- print to-dos shows month name in the top left in "format" instead of "stand-alone",
- print week shows name in the top left in "format" instead of "stand-alone", while single day dates show up in American format,
- print month shows month names in "format" instead of "stand-alone" in all instances,
- timeline header shows the date in American format.

I made screenshots with the wrong dates and headers highlighted just in case: https://chmura.kulik.si/s/sSoJ8DrrXkiPby4
Comment 3 Grzegorz Kulik 2022-05-05 17:34:26 UTC
Actually I just switched KOrganizer to German and in the print event preview the date I mentioned showed up in German format, so I'm guessing it's a matter of an incomplete translation. I checked the other instances of the American format and they persist in the German version.
Comment 4 gjditchfield 2022-05-06 21:14:24 UTC
(In reply to Grzegorz Kulik from comment #2)
> - timeline header shows the date in American format.

Is the month name in the incorrect case — should the timeline
header display "czw. 5 moja 2022"?
Comment 5 gjditchfield 2022-05-06 21:17:18 UTC
Git commit 6a6d73274f088194ae77765854d7a06aa19d5806 by Glen Ditchfield.
Committed on 06/05/2022 at 21:17.
Pushed by gditchfield into branch 'release/22.04'.

Use standaloneMonthName in the Month View's header

Use `standaloneMonthName()` to generate the month name in the Month
View's header, as is done by KOrganizer's date navigator, because
`QString::toString()` produces inappropriate month names for Slavic
languages in this context.

Related: https://invent.kde.org/pim/calendarsupport/-/merge_requests/43

M  +4    -1    src/month/monthscene.cpp

https://invent.kde.org/pim/eventviews/commit/6a6d73274f088194ae77765854d7a06aa19d5806
Comment 6 Grzegorz Kulik 2022-05-06 21:38:46 UTC
(In reply to gjditchfield from comment #4)
> (In reply to Grzegorz Kulik from comment #2)
> > - timeline header shows the date in American format.
> 
> Is the month name in the incorrect case — should the timeline
> header display "czw. 5 moja 2022"?

"czw. 5 moja 2022" is the right format.
Comment 7 gjditchfield 2022-05-06 21:55:09 UTC
Git commit 2fd753e34b5ee3882af8d4cc7a8aa74414d02253 by Glen Ditchfield.
Committed on 06/05/2022 at 21:55.
Pushed by gditchfield into branch 'release/22.04'.

Use standaloneMonthName in the printed month's header

Use `standaloneMonthName()` to generate the month name in the printed
month's header, as is done by KOrganizer's date navigator, because
`monthName()` produces inappropriate month names for Slavic
languages in this context.

Related: https://invent.kde.org/pim/eventviews/-/merge_requests/68

M  +0    -1    src/freebusymodel/freeperiodmodel.cpp
M  +8    -6    src/printing/calprintdefaultplugins.cpp
M  +6    -4    src/printing/calprintpluginbase.cpp

https://invent.kde.org/pim/calendarsupport/commit/2fd753e34b5ee3882af8d4cc7a8aa74414d02253
Comment 8 gjditchfield 2022-05-06 22:34:55 UTC
I believe I've fixed all of the month names that should be stand-alone.

The American dates in printed events and printed weeks are the result of
missing translations, since i18n code is in the right places.  If you haven't
reported translation problems before: create a bug report for product i18n,
with the language as the component.

The American date in the Timeline header is the result of a flaw in the
KDiagram framework, which will take more work.
Comment 9 gjditchfield 2022-05-25 17:28:42 UTC
Git commit 7d33b4e091d13b7dd255d6682aa434b9a0e2f657 by Glen Ditchfield, on behalf of Glen Ditchfield.
Committed on 16/05/2022 at 18:51.
Pushed by gditchfield into branch 'master'.

Improve internationalization in KGantt

`QDate::toString()` does not fully localize dates:  it does not reorder
date components or choose the proper form of month names.  For example,
in a Polish locale it returns "maj 1" instead of "1 maja".
Furthermore, in Qt6 date and time `toString()` methods will not perform
localization.

This patch switches to `QLocale()::toString()`.

M  +5    -4    src/KGantt/kganttdatetimegrid.cpp
M  +2    -1    src/KGantt/kganttgraphicsview.cpp

https://invent.kde.org/graphics/kdiagram/commit/7d33b4e091d13b7dd255d6682aa434b9a0e2f657