diff options
author | Mike FABIAN <mike.fabian@basyskom.de> | 2010-05-26 19:46:26 +0200 |
---|---|---|
committer | Mike FABIAN <mike.fabian@basyskom.de> | 2010-05-27 14:30:30 +0200 |
commit | 1da1ff3ccfcf24476d246527934061ad7b0ae6a3 (patch) | |
tree | 13babfdcbbc33876cb043c54b33b2773ffde11b1 /src/corelib/i18n/mlocale.cpp | |
parent | 670c2dd0ad4f76afc84dc0b085880132ed2efb99 (diff) |
Changes: use DateSymbolStandalone for monthName() and weekdayName()
RevBy: Björn Schnabel, Holger Schröder
Details:
Fixes part of NB#169260.
Jarkko wrote in NB#169260:
The current CLDR gives the Finnish day names and month names in a
inflected form. We need forms in the basic form. These are now listed
as "proposed" in the CLDR list.
e.g. maanantaina -> must be maanantai (on Monday -> Monday)
kesäkuuta -> must be kesäkuu (of June -> June)
That means that monthName() and weekdayName() should
use DateSymbolStandalone instead of DateSymbolFormat.
Diffstat (limited to 'src/corelib/i18n/mlocale.cpp')
-rw-r--r-- | src/corelib/i18n/mlocale.cpp | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/src/corelib/i18n/mlocale.cpp b/src/corelib/i18n/mlocale.cpp index c57cb61a..67f165e2 100644 --- a/src/corelib/i18n/mlocale.cpp +++ b/src/corelib/i18n/mlocale.cpp @@ -1695,28 +1695,7 @@ QDateTime MLocale::parseDateTime(const QString &dateTime, CalendarType calendarT #ifdef HAVE_ICU QString MLocale::monthName(const MCalendar &mCalendar, int monthNumber) const { - Q_D(const MLocale); - monthNumber--; // months in array starting from index zero - - // use message locale as the output language - icu::Locale symbolLocale - = MIcuConversions::createLocale(d->categoryName(MLcMessages), - mCalendar.type()); - - icu::DateFormatSymbols *dfs = MLocalePrivate::createDateFormatSymbols(symbolLocale); - - int len; - const UnicodeString *months = dfs->getMonths(len); - - QString result; - - if (monthNumber < len && monthNumber >= 0) { - result = MIcuConversions::unicodeStringToQString(months[monthNumber]); - } - - delete dfs; - - return result; + return monthName(mCalendar, monthNumber, MLocale::DateSymbolStandalone, MLocale::DateSymbolWide); } #endif @@ -1761,27 +1740,7 @@ QString MLocale::monthName(const MCalendar &mCalendar, int monthNumber, #ifdef HAVE_ICU QString MLocale::weekdayName(const MCalendar &mCalendar, int weekday) const { - Q_D(const MLocale); - // use message locale as the output language - icu::Locale symbolLocale - = MIcuConversions::createLocale(d->categoryName(MLcMessages), - mCalendar.type()); - - icu::DateFormatSymbols *dfs = MLocalePrivate::createDateFormatSymbols(symbolLocale); - - int len; - const UnicodeString *weekdayNames = dfs->getWeekdays(len); - int weekdayNum = MIcuConversions::icuWeekday(weekday); - - QString result; - - if (weekdayNum < len && weekdayNum > 0) { - result = MIcuConversions::unicodeStringToQString(weekdayNames[weekdayNum]); - } - - delete dfs; - - return result; + return weekdayName(mCalendar, weekday, MLocale::DateSymbolStandalone, MLocale::DateSymbolWide); } #endif |