KLocale, monthName() and grammar issues

Jacek Stolarczyk jacek at mer.chemia.polsl.gliwice.pl
Fri Jul 19 12:57:38 BST 2002


Hi,

There is a problem with current usage of KLocale::monthName in formatDate
(and its family) functions which comes from a different way long dates are
presented in some languages. Polish language is definitely affected, and I
believe other slavic languages as well.

These languages use a form "of May", "of June", "of July" e.g.
something along 19th of July 2002. That "of July" is a one word but of
different form than the basic one ("July"). So we would rather write:
"19 lipca 2002" but the name of the month is "lipiec". The latter form
would be used in a calendar app (like KOrganizer) where it displays only
nameof the month. But in a KWord document one would expect to insert "19
lipca 2002" rather than "19 lipiec 2002".

Looking into KLocale sources it seems that the easiest solution would be
to provide another function similar to monthName (monthDeclinedName, but
better name is welcome:) which would give proper names. That function
would be used in formatDate function. To avoid confusion for languages
with simpler grammar rules (like English) we could extend m_dateFormat
format with another pair of characters (z, Z). These characters would
trigger using monthDeclinedName rather that monthName. Something like in
this snippet of code:

case 'b':
    put_it_in( buffer, index, monthName(pDate.month(), true) );
    break;
case 'B':
    put_it_in( buffer, index, monthName(pDate.month(), false) );
    break;
case 'z':
    put_it_in( buffer, index, monthDeclinedName(pDate.month(), true) );
    break;
case 'Z':
    put_it_in( buffer, index, monthDeclinedName(pDate.month(), false) );
    break;

I hope I have made it clear. I imagine there may be problem with BIC
(adding another function to KLocale). Other solution would be to extend
monthName accordingly to handle both cases. Maybe that's even simpler.

And yes, I'm willing to code this if an agreement is reached ;-)

Best wishes,

Jacek Stolarczyk
PS. Cc'ed to Polish translators' list. If anyone from this list wishes to
reply (and crosspost to kde lists), please remember to write in English
;-) --
jstolarz at kde.org
Coordinator of Polish translations of KDE






More information about the kde-core-devel mailing list