diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2024-04-03 18:50:51 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2024-04-19 13:39:41 +0200 |
commit | 42e4e1816ab6822eb431d8e16d9979bd72a19fdf (patch) | |
tree | a8799099a353f19cc20497e182163eea48241535 /tests/auto | |
parent | d778d17b9f023e115dfbaa4bbd7255b52f41e67f (diff) |
Fix handling of am/pm indicators in mapping from CLDR to Qt formats
Both qlocale_mac.mm and dateconverter.py were mapping the CLDR am/pm
indicator, 'a', to the Qt format token 'AP', forcing the indicator to
uppercase. The LDML spec [0] says:
May be upper or lowercase depending on the locale and other
options.
[0] https://www.unicode.org/reports/tr35/tr35-68/tr35-dates.html#Date_Field_Symbol_Table
We don't support the "other options" mentioned, but we can at least
(since 6.3) preserve the the locale-appropriate case, instead of
forcing upper-case. As such, this change is a follow-up to
commit 4641ff0f6a1b0da6f55db5e33c58a77be2032808
Changes locale data, as expected, to use "Ap" in place of "AP" in
various formats in the time_format_data[] array.
[ChangeLog][QtCore][QLocale] Where CLDR specifies an am/pm indicator,
the case of the CLDR-supplied indicator is used, where previously
QLocale forced it to upper-case.
Change-Id: Iee7d55e6f3c78372659668b9798c8e24a1fa8982
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 872c9f115b..946a7e6821 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -3341,10 +3341,10 @@ void tst_QLocale::timeFormat() QCOMPARE(bra.timeFormat(QLocale::ShortFormat), QLatin1String("HH:mm")); QCOMPARE(bra.timeFormat(QLocale::LongFormat), QLatin1String("HH:mm:ss t")); - // QTBUG-123872 - we kludge CLDR's B to AP: + // QTBUG-123872 - we kludge CLDR's B to Ap: const QLocale tw("zh_TW"); - QCOMPARE(tw.timeFormat(QLocale::ShortFormat), "APh:mm"_L1); - QCOMPARE(tw.timeFormat(QLocale::LongFormat), "APh:mm:ss [t]"_L1); + QCOMPARE(tw.timeFormat(QLocale::ShortFormat), "Aph:mm"_L1); + QCOMPARE(tw.timeFormat(QLocale::LongFormat), "Aph:mm:ss [t]"_L1); } void tst_QLocale::dateTimeFormat() |