Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.6, 5.15.0
-
None
-
-
062d2831845eb07518d7c059b155a640bd0300f3 (qt/qtbase/dev) 0df8e70fbde912b7ee6a594112c13221ea338f72 (qt/qtbase/5.15)
Description
Code bellow prints:
августа августа
while the second line should be "август", without "a" at the end of word.
This is for Russian locale.
If instead of system I create such locale `QLocale loc(QLocale::Russian, QLocale::RussianFederation);` all works in the right way.
Also code bellow works just fine on Linux with ru_RU.UTF-8 locale.
#include <QApplication> #include <QDateTime> #include <QLocale> #include <QtDebug> int main(int argc, char *argv[]) { QApplication app(argc, argv); auto dt = QDateTime::currentDateTime(); auto loc = QLocale::system(); qDebug() << loc.monthName(dt.date(). month()); qDebug() << loc.standaloneMonthName(dt.date(). month()); }
I suspect that problem in qlocale_mac.mm code:
case MonthNameLong: case MonthNameShort: case StandaloneMonthNameLong: case StandaloneMonthNameShort: return macMonthName(in.toInt(), (type == MonthNameShort || type == StandaloneMonthNameShort));
for some reason it ignores StandaloneMonth* and in macMonthName it uses only
kCFDateFormatterMonth* in standalone and not standalone case,
while there is:
kCFDateFormatterStandaloneMonthSymbols constant
Attachments
Issue Links
- relates to
-
QTBUG-86279 QLocale::system()'s standaloneDayName() and dayName() use the same back-end
- Closed
For Gerrit Dashboard: QTBUG-86191 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
311652,2 | macOS: fix standaloneMonthName implementation for system locale | dev | qt/qtbase | Status: MERGED | +2 | 0 |
311761,2 | macOS: fix standaloneMonthName implementation for system locale | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |