Add tests that zh-TW now correctly prefers zh-TW over zh translation
The bug, QTBUG-121418, was actually fixed earlier by commit 84afaafc9c6968dd76fcadc5392065d340543521 (or, for 6.8, commit 8c40e8cf12bb931149367677c56816864265249c), but escaped our attention at the time. Fixes: QTBUG-121418 Pick-to: 6.8 Change-Id: Ie24eb172674189079aede7a39584ea760aac1b0c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 12f8ebf5cbdc9089564a93001926d20908bd1785) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6d0f277a40
commit
ee65d651a4
@ -174,6 +174,7 @@ void tst_QTranslator::loadLocale_data()
|
||||
QTest::addRow("Australia")
|
||||
<< QLocale("en-AU")
|
||||
<< QStringList{"en-Latn-AU", "en-AU", "en"};
|
||||
QTest::addRow("Taiwan") << QLocale("zh-TW") << QStringList{"zh-TW", "zh"};
|
||||
|
||||
// This produces a QLocale::uiLanguages list of
|
||||
// {"en-NO", "en-Latn-NO", "nb-NO", "nb-Latn-NO", "nb",
|
||||
@ -184,6 +185,7 @@ void tst_QTranslator::loadLocale_data()
|
||||
QTest::addRow("System, mixed dialects")
|
||||
<< QLocale::system()
|
||||
<< QStringList{"en-AU", "en-NZ", "de-DE", "en-GB"};
|
||||
QTest::addRow("System, Taiwan") << QLocale::system() << QStringList{"zh-TW", "zh"};
|
||||
}
|
||||
|
||||
void tst_QTranslator::loadLocale()
|
||||
|
@ -3704,6 +3704,9 @@ void tst_QLocale::uiLanguages_data()
|
||||
QTest::newRow("zh_Hant")
|
||||
<< QLocale("zh_Hant")
|
||||
<< QStringList{u"zh-Hant-TW"_s, u"zh-TW"_s, u"zh-Hant"_s, u"zh"_s};
|
||||
QTest::newRow("zh_TW")
|
||||
<< QLocale("zh_TW")
|
||||
<< QStringList{u"zh-Hant-TW"_s, u"zh-TW"_s, u"zh-Hant"_s, u"zh"_s};
|
||||
|
||||
QTest::newRow("zh_Hans_CN")
|
||||
<< QLocale(QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China)
|
||||
@ -4189,6 +4192,9 @@ void tst_QLocale::mySystemLocale_data()
|
||||
QTest::addRow("chinese-full")
|
||||
<< u"zh-Hans-CN"_s << QLocale::Chinese
|
||||
<< QStringList{u"zh-Hans-CN"_s, u"zh-CN"_s, u"zh"_s, u"zh-Hans"_s};
|
||||
QTest::addRow("chinese-taiwan")
|
||||
<< u"zh-TW"_s << QLocale::Chinese
|
||||
<< QStringList{u"zh-TW"_s, u"zh-Hant-TW"_s, u"zh-Hant"_s, u"zh"_s};
|
||||
|
||||
// For C, it should preserve what the system gave us but only add "C", never anything more:
|
||||
QTest::addRow("C") << u"C"_s << QLocale::C << QStringList{u"C"_s};
|
||||
|
Loading…
x
Reference in New Issue
Block a user