Bug 196108

Summary: kmail mistakenly uses genetive while displaying months only in message list (in Polish, language dependent)
Product: [Unmaintained] kmail Reporter: Marcin Trybus <mtrybus>
Component: new message listAssignee: Szymon Stefanek <pragma>
Status: RESOLVED FIXED    
Severity: normal CC: kollix, mss, to.roma.from.kdebug, tommi.nieminen
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Illustration of the bug (yellow areas used for privacy)

Description Marcin Trybus 2009-06-11 23:42:24 UTC
Version:            (using KDE 4.2.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

I reported it yesterday to Debian as bug #532696, but I was asked to send it upstream. 
Original bug report: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532696 

Sorry if this was reported before. I didn't have time to look through the list very meticulously. 

This problem is language specific so I guess I should describe what I mean.

KDE always had my appreciation for using the correct grammatical case for dates when the appropriate option in local settings was ticked. The problem is Polish only uses genetive for specific dates. Eg. current month in Polish is 'czerwiec' (June) and the date today is '11 czerwca'. (It comes from the full expression that can be translated as 'June's 11th day', hence genetive is used.) 

Anyway, the problem is kmail uses the month's name in genetive even without the day, which looks really silly. It's visible eg. in inbox where old messages are grouped by month. 

Since KDE already stores both versions of the month's name it's the problem of kmail using one of them to display dates whereas it should mix and match to fit the usage. I'm not sure how this looks like in different languages, but I'm quite certain all Slavic languages follow the same pattern.
Comment 1 Szymon Stefanek 2009-06-12 20:32:42 UTC
Could you please post a screenshot of what you see ?

It looks like you're talking about strings that come
from a call to QDate::longMonthName(), but I need to be sure.
Comment 2 Marcin Trybus 2009-06-13 12:21:39 UTC
Created attachment 34497 [details]
Illustration of the bug (yellow areas used for privacy)

That's how the bug looks like. Since it's all about language I'll briefly describe what's wrong. 

1. List of old messages contains month names in genetive, eg. "Maja" in top line. Date in Polish (and other Slavic languages I'm familiar with) uses genetive only for full dates (eg. day+month, or day+month+year). In this instance (month, or month+year only) nominative should be used instead. Both forms are available in language pack, so it's just a matter of picking the right form for each case. 

2. In the blue pop-up on the right we read "Wątki z wiadomościami stworzonymi Czerwca 2008." Genetive is used where locative should be. This is not even a grammatical error, it's an abomination. Locative is most likely not included into the language pack, so it could use some thought from the language team(s) on how to rephrase that. At the very least nominative should be used, which is just as wrong but not half as repulsive. That's how the translations of unpolished programs and closed source programs usually handle this. Not that I approve that, but it's done for the sake of lower complexity. 

Polish with its 7 noun cases (and again other Slavic languages) don't take word manipulation as lightly as eg. English. I don't expect this to be perfect, but problem #1 is fixable, whereas problem #2 could be improved even without coding.
Comment 3 Tommi Nieminen 2009-07-13 15:54:03 UTC
I think I know how this comes about: KMail seems to obtain the month name by parsing the long date format string, not by directly requesting the month name from the locale.

The long date format is set in KDE regional settings. In English with only one (or two) morphological cases, you can use that string to get a month name (eg., “13 July 2009” -> strip date and year -> “July”). In most languages it’s more complicated than that. In Finnish, for instance, the correct long date format would be ”13. heinäkuuta 2009” (where “heinäkuu” ‘July’ – month names are not capitalized in Finnish unless at the beginning of a sentence), and quite as expected, KMail now uses “Heinäkuuta” as the header in aggregation by date, not “Heinäkuu” or even “Heinäkuussa” ‘in July’ which would be acceptable.

The solution then is easy: don’t try to parse the long date format string but instead get the month name directly from the locale. It should be possible, since the KDE regional settings configuration module can do it too.
Comment 4 Martin Koller 2009-09-01 00:08:34 UTC
What date format do you use (kmails configure dialog /  appearance / message list) ?

@comment #3: no, we're not parsing a string here.
Comment 5 Tommi Nieminen 2009-09-01 10:14:54 UTC
I wonder whether we are talking about two different things. *I* didn’t mean date strigns in the message list, which are controlled in KMail’s settings dialog, but the aggregation and group headers. The former are OK, the latter are not.

Currently I’ve set the long date formatting string in KDE’s regional settings to “WEEKDAYna dD. MONTHta YYYY” (the formatting variables are actually localized too but let’s skip that). Now, it’s exactly “MONTHta” that appears in the my KMail aggregations and group headers. If I change the formatting string the regional settings, KMail’s usage follows that change. However, it’s clear that KDE somewhere holds the original, un-case suffixed, month names too, since the formatting variable MONTH can fetch them.
Comment 6 Martin Koller 2009-09-01 22:01:51 UTC
I just had a quick look yesterday into the code and I thought it uses the kmail setting - however, I was wrong.
I already found the code where the monthname etc. is created for the GroupHeader - and it's currently not using KDE's locale/calendarsystem.
I'm checking how to best fix that.
Comment 7 Martin Koller 2009-09-02 00:34:21 UTC
*** Bug 191883 has been marked as a duplicate of this bug. ***
Comment 8 Martin Koller 2009-09-02 00:47:46 UTC
*** Bug 178754 has been marked as a duplicate of this bug. ***
Comment 9 Martin Koller 2009-09-02 23:18:26 UTC
SVN commit 1019109 by mkoller:

BUG: 196108

Use KDE's locale/calendar settings for the Group Header in aggregations


 M  +9 -46     model.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1019109
Comment 10 Volker Krause 2009-09-15 10:00:02 UTC
SVN commit 1023670 by vkrause:

Merge SVN commit 1019109 by mkoller from trunk:

CCBUG: 196108

Use KDE's locale/calendar settings for the Group Header in aggregations


 M  +9 -46     model.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1023670