qt6-bb10/tests/auto/corelib/kernel/qtranslator
Volker Hilsheimer 8c40e8cf12 QTranslator: work around uiLanguages not including lang_Terr variants
Amends 7a7f2547f3, which added the triplet
including the script before the language_Territory name without it. The
truncate-from-the-end algorithm in QTranslator ended up trying the pure
language first, and - if found - ignored any more specific territory-
variant that might be present.

To fix this, replace the truncate-from-the-end algorithm when we try
to find files, and instead create a comprehensive list of fallbacks,
avoiding duplicates as we go along. Insert those fallbacks right after
their base-entry. We then try to find files for each entry, with and
without the prefix.

This fix is needed only in 6.8 and 6.5; from 6.9 onwards, the change to
QLocale::uiLanguages in 84afaafc9c6968dd76fcadc5392065d340543521 fixes
this on the correct level, making kludges in QTranslator unnecessary.

As a drive-by, replace int indices in for-loops with qsizetype.

Fixes: QTBUG-124898
Pick-to: 6.5
Change-Id: Ia3deceb4ed2c6ef5ca0a815cc7b8878bf29ef088
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-10-31 23:15:29 +02:00
..
.gitignore
CMakeLists.txt QTranslator: rewrite loadLocale test, include failing cases 2024-10-10 11:21:41 +00:00
dependencies_la.qm
dependencies_la.ts
hellotr_empty.qm
hellotr_empty.ts
hellotr_la.qm
hellotr_la.ts
msgfmt_from_po.qm
tst_qtranslator.cpp QTranslator: work around uiLanguages not including lang_Terr variants 2024-10-31 23:15:29 +02:00