| Summary: | Calendar tool still messing with fonts and locales | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | lorenzo |
| Component: | Plugin-Generic-Calendar | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | caulier.gilles |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented 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
Created attachment 9121 [details]
Mixed translations
Created attachment 9122 [details]
AMS as default font
Created attachment 9132 [details]
Correct i18n of month names using QDate::longMonthName instead of deprecated KGlobal::locale()->monthName
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 Created attachment 9368 [details]
Showing locale month name, english day abbriviation
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)),
Problem is not reproducible with Calendar tool implemented in digiKam core since 5.x version Gilles Caulier |