From 0118e2e9151ae3e1e1cd72f24e8c129eaa69dc4f Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 29 Apr 2019 12:33:55 +0200 Subject: Include likely-adjusted uiLanguages for the system locale QLocale::uiLanguages() on the system locale uses whatever the system locale's query(QSystemLocale::UILanguages,...) returns. On Android, this is just a list of locales. However, for non-system locales, we also include some results of removing likely sub-tags from the locale name, where equivalent. Thus zh-CN would also get zh and zh-Hans-CN added to it; however, if the system locale is zh-Hans-CN, the shorter forms are omitted. So post-process the system locale list in the same way, albeit tweaked to avoid duplicates and rearranged so that we can insert likely-adjusted entries between what they adjust and what followed it. Added QLocalePrivate::rawName() in the process, since it looks likely to be useful in other contexts (and I needed its value): it just joins such tags as are non-Any. This, however, uses QByteArrayList, so added that (it's small) to the bootstrap library and qmake. This follows up on commit 8796e3016fae1672e727e2fa4e48f671a0c667ba. [ChangeLog][QtCore][QLocale] The system locale's UI languages list now includes, as for that of an ordinary locale, the results of adding likely sub-tags from each locale name, and of removing some, where this doesn't change which locale is specified. This gives searches for translation files a better chance of finding a suitable file. Fixes: QTBUG-75413 Change-Id: Iaafd79aac6a0fdd5f44aed16e445e84a2267c9da Reviewed-by: Paul Wicking Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/tools/bootstrap/bootstrap.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tools') diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index f9ffd1bbea..09a1c68001 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -75,6 +75,7 @@ SOURCES += \ ../../corelib/serialization/qxmlutils.cpp \ ../../corelib/serialization/qxmlstream.cpp \ ../../corelib/text/qbytearray.cpp \ + ../../corelib/text/qbytearraylist.cpp \ ../../corelib/text/qbytearraymatcher.cpp \ ../../corelib/text/qlocale.cpp \ ../../corelib/text/qlocale_tools.cpp \ -- cgit v1.2.3