Bug 97187 - Calendar tool still messing with fonts and locales
Summary: Calendar tool still messing with fonts and locales
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-Calendar (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-16 22:03 UTC by lorenzo
Modified: 2017-07-09 13:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments
Mixed translations (19.78 KB, image/png)
2005-01-16 22:04 UTC, lorenzo
Details
AMS as default font (19.78 KB, image/png)
2005-01-16 22:05 UTC, lorenzo
Details
Correct i18n of month names using QDate::longMonthName instead of deprecated KGlobal::locale()->monthName (3.92 KB, patch)
2005-01-17 08:38 UTC, lorenzo
Details
Showing locale month name, english day abbriviation (24.59 KB, image/png)
2005-01-31 14:35 UTC, Rutger Claes
Details

Note You need to log in before you can comment on or make changes to this bug.
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