Reinstate the month name capitalization

Some CLDR (locale) data used by Qt have standalone month names
starting with lower-case letters. So if we want to provide consistent
look across locales, we need to capitalize it ourselves

See https://bugreports.qt-project.org/browse/QTBUG-35100
This commit is contained in:
Martin Klapetek 2013-11-25 17:00:19 +01:00
parent 580d7d198a
commit d1dc311345

View File

@ -132,7 +132,13 @@ QString Calendar::errorMessage() const
QString Calendar::monthName() const
{
return QDate::longMonthName(m_startDate.month(), QDate::StandaloneFormat);
// Some CLDR (locale) data used by Qt have standalone months names
// starting with lower-case letters. So if we want to provide consistent
// look across locales, we need to capitalize it ourselves
//
// see https://bugreports.qt-project.org/browse/QTBUG-35100
QString tmp = QDate::longMonthName(m_startDate.month(), QDate::StandaloneFormat);
return tmp.left(1).toUpper() + tmp.mid(1);
}
int Calendar::year() const