Add QTranslator test for script-incompatible language truncation

Amends commit 0278a80d6876f38bb37f1d504e6b24a3512efb7a - I developed
the new test as part of adapting the earlier change to 6.8.

Task-number: QTBUG-131894
Change-Id: I711e62db7e35fa26c396498354ffbb5aa23920a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dabc113cc89c9b15e76ba8448e8abba3c9722f47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Edward Welbourne 2025-04-30 15:26:53 +02:00 committed by Qt Cherry-pick Bot
parent d40e353821
commit 9911f7c90d

View File

@ -186,6 +186,13 @@ void tst_QTranslator::loadLocale_data()
<< QLocale::system() << QLocale::system()
<< QStringList{"en-AU", "en-NZ", "de-DE", "en-GB"}; << QStringList{"en-AU", "en-NZ", "de-DE", "en-GB"};
QTest::addRow("System, Taiwan") << QLocale::system() << QStringList{"zh-TW", "zh"}; QTest::addRow("System, Taiwan") << QLocale::system() << QStringList{"zh-TW", "zh"};
// This tests that, when "just the language" is not a faithful
// representation of the entry it's derived from, we try later entries
// before it.
QTest::addRow("System, multi-script language")
<< QLocale::system()
<< QStringList{"pa-Arab-GB", "pa-PK", "en-GB"};
} }
void tst_QTranslator::loadLocale() void tst_QTranslator::loadLocale()