RFC: Add Working Week and Day of Pray to KLocale

John Layt johnlayt at googlemail.com
Tue Nov 4 07:37:00 GMT 2008


[Copied to kdepim and i18n lists for their thoughts, please reply on k-c-d]

I want to propose some additions to KLocale to provide more accurate calendar 
functions and improve the colouring of calendar widgets.  It's a very simple 
change, but as it's KLocale I thought I would run it past everyone first.

Currently, the KDEUI::KDateTable calendar widget is hard-coded to colour the 
Saturday and Sunday headers as the weekend whenever the calendar system is 
Gregorian, and colour only KCalendarSystem::weekDayOfPray() as the weekend 
when it's not, i.e. Hijri, Jalali, and Hebrew calendar users only get a one 
day weekend.  KOrganizer::KoDayMatrix does something similar.  However, as the 
following quote from Wikipedia [1] makes clear, the definition of working week 
is not universal and is actually a function of Locale and not Calendar System:

"In Muslim-majority countries the legal work week in the Middle East is 
typically either Saturday through Wednesday (as in Algeria and Saudi Arabia), 
Saturday through Thursday (as in Iran) or Sunday through Thursday (as in 
Egypt, Syria, United Arab Emirates) However, in secular Turkey and Lebanon the 
work week is Monday through Friday, as in Western countries."

It would seem logical then to add the start and end of the working week to the 
locale.  KOrganiser allows you to select each individual working day but I 
don't think this is needed at locale level.

KCalendarSystem::weekDayOfPray() is also problematic as the Gregorian 
calendar is used in many locales which are not predominantly Christian and so 
users may want a different day coloured for religious observance (e.g. 
Turkey), or an individual may belong to a religion that chooses a different 
day of observance than the Calendar System used in their country (e.g.  
Seventh Day Adventists).  There are also those who may not want such a day 
displayed.  This also seems logical to be added to the locale.

I've made the following changes:

1) Added workingWeekStartDay and workingWeekEndDay to KLocale, defaulting to 
Monday and Friday

2) Added weekDayOfPray to KLocale, defaulting to Sunday, with value of 0 = 
none.  I'm not keen on weekDayOfPray as a name, but it's consistent with the 
current KCalendarSystem name, and weekDayOfReligiousObservance is a bit long.

3) Added all three new options to the KCM.

4) Updated i10l template README.

5) Updated KCalendarSystem::weekDayOfPray documentation.

6) Modify KDateTable to display the weekday header shading based on the locale 
working week, and red-letter the day number for the locale day of prayer.

Once committed, the i10l guys would need to update their country locale files 
to set the correct value if the defaults are not valid.

The kdepim guys can choose how they want to use this in KoDayMatrix, but I 
would suggest a consistent behaviour.

Going further, I'm sure many users would want to see their locale's public 
holidays displayed as well in things like the panel clock/calendar, and even 
their full PIM data.  I feel this would be too much for the kdelibs widget to 
support, especially as KOrganiser::KoDayMatrix already supports all this, and 
apps/widgets can choose to use that instead.  The problem here is that while 
KHolidays is in kdepimlibs, KoDayMatrix is not, so for example the panel clock 
cannot rely on it.  The obvious answer is to move KoDayMatrix/KoDateNavigator 
to kepimlibs, but I don't know if that is even possible?  Alternatively, a 
kdepim plasmoid could be provided that a user can choose to switch the panel 
clock to.  I'm not sure what kdepim has planned in this area?  A compromise 
would be for KDateTable to dynamically detect if kdepimlibs is installed, and 
if so display the relevant holidays.

Comments gratefully received.

John.

[1] http://en.wikipedia.org/wiki/Weekend



-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs-workweek.diff
Type: text/x-patch
Size: 10470 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081104/c9044a7e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase-workweek.diff
Type: text/x-patch
Size: 10304 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081104/c9044a7e/attachment-0001.bin>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-core-devel mailing list