Bug 97187

Summary: Calendar tool still messing with fonts and locales
Product: [Applications] digikam Reporter: lorenzo
Component: Plugin-Generic-CalendarAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 5.7.0
Sentry Crash Report:
Attachments: Mixed translations
AMS as default font
Correct i18n of month names using QDate::longMonthName instead of deprecated KGlobal::locale()->monthName
Showing locale month name, english day abbriviation

Description lorenzo 2005-01-16 22:03:12 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Debian testing/unstable Packages
OS:                Linux

It's a long time since I last tried the calendar export plugin; I think I somewhat reported the fonts and locale problems, but I don't find the bug report, and the both problems are still there.

1. The font chooser does suggest "strange" fonts, like the AMS and the computer modern ones, and defaults to AMS insted of one of the kde predefined ones;

2. There is mixed localisation in effect: while week days' names are translated to my italian locale, the month name is in English.

3. (But this is only a wish) It would be nice if one could be choose different the fonts for the various page parts; bonus wishes: importing holidays, birthdays and so on from kalendar and putting the moon phases and/or the dawn/sunset times.
Comment 1 lorenzo 2005-01-16 22:04:43 UTC
Created attachment 9121 [details]
Mixed translations
Comment 2 lorenzo 2005-01-16 22:05:34 UTC
Created attachment 9122 [details]
AMS as default font
Comment 3 lorenzo 2005-01-17 08:38:42 UTC
Created attachment 9132 [details]
Correct i18n of month names using QDate::longMonthName instead of deprecated KGlobal::locale()->monthName
Comment 4 Rutger Claes 2005-01-31 14:31:05 UTC
Im running the Dutch translation;
Here the mixed translations is the other way around.  I get the month in Dutch but the weekdays in English.
Will be adding screenshot for confirmation.
Kipi version: 0.0.cvs20041212-0kalyxo1 from kalyxo staging (http://www.kalyxo.com) with digiKam 0.7 using KDE 3.3.2 and Kipi library version 0.1.0
Comment 5 Rutger Claes 2005-01-31 14:35:45 UTC
Created attachment 9368 [details]
Showing locale month name, english day abbriviation
Comment 6 Tom Albers 2005-08-07 17:47:39 UTC
SVN commit 443854 by toma:

Fixed 3 problems:
- compiler deprecated barfs on monthNames.
- the weekday was not localized, so they were english.
- default font in pull down is now the application dafault font.

BUG: 97187



 M  +36 -3     calpainter.cpp  
 M  +4 -0      caltemplate.cpp  


--- trunk/extragear/libs/kipi-plugins/calendar/calpainter.cpp #443853:443854
@@ -35,6 +35,8 @@
 
 #include <kglobal.h>
 #include <klocale.h>
+#include <kdeversion.h>
+#include <kcalendarsystem.h>
 
 // Local includes.
 
@@ -202,8 +204,13 @@
     painter->setFont(f);
     painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
                       QString::number(year_));
+#if KDE_IS_VERSION(3,2,0)
     painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+                      KGlobal::locale()->calendar()->monthName(month_, year_));
+#else
+    painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
                       KGlobal::locale()->monthName(month_));
+#endif
     painter->restore();
 
     // ---------------------------------------------------------------
@@ -226,8 +233,14 @@
         rsmall = r;
         rsmall.setWidth(r.width() - 2);
         rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
         painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
-                   QDate::shortDayName(i+1));
+                          KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+        painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+                          KGlobal::locale()->weekDayName(i+1, true));
+#endif
+
     }
 
     painter->restore();
@@ -422,8 +435,13 @@
     painter->setFont(f);
     painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
                       QString::number(year));
+#if KDE_IS_VERSION(3,2,0)
     painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+                      KGlobal::locale()->calendar()->monthName(month, year));
+#else
+    painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
                       KGlobal::locale()->monthName(month));
+#endif
     painter->restore();
 
     // ---------------------------------------------------------------
@@ -446,8 +464,13 @@
         rsmall = r;
         rsmall.setWidth(r.width() - 2);
         rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
         painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
-                   QDate::shortDayName(i+1));
+                          KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+        painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+                          KGlobal::locale()->weekDayName(i+1, true));
+#endif
     }
 
     painter->restore();
@@ -619,8 +642,13 @@
     painter->setFont(f);
     painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
                       QString::number(year));
+#if KDE_IS_VERSION(3,2,0)
     painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+                      KGlobal::locale()->calendar()->monthName(month, year));
+#else
+    painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
                       KGlobal::locale()->monthName(month));
+#endif
     painter->restore();
 
     // ---------------------------------------------------------------
@@ -643,8 +671,13 @@
         rsmall = r;
         rsmall.setWidth(r.width() - 2);
         rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
         painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
-                   QDate::shortDayName(i+1));
+                          KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+        painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+                          KGlobal::locale()->weekDayName(i+1, true));
+#endif
     }
 
     painter->restore();
--- trunk/extragear/libs/kipi-plugins/calendar/caltemplate.cpp #443853:443854
@@ -184,7 +184,11 @@
     }
     comboFont_->insertStringList(smoothScalableFamilies);
 
+    // fetch and set the default font selected in the combo.
+    QFont f;
+    comboFont_->setCurrentText( f.family() );
 
+    
     gboxLayout->addLayout( hlayout );
 
     connect(comboFont_, SIGNAL(activated(int)),
Comment 7 caulier.gilles 2017-07-09 13:51:47 UTC
Problem is not reproducible with Calendar tool implemented in digiKam core since 5.x version

Gilles Caulier