6a14ad4993
The collection of translations available to us need not have anything to do with whether CLDR has matching data, so preserve the system UI language list's entries as they are, rather than forcing them through the QLocale constructor's exercise of likely sub-tag rules. Instead, simply parse the given locale tags to QLocaleId instances and use these in the likely-subtag processing to determine what other entries to add to the list in addition to those supplied by the operating system. Since going via QLocale did usually supply a territory, that was included in the BCP 47 name, it's now possible for the given entry to lack the language_territory name, so be sure to add that if missing. This incidentally reduces heap traffic and saves a fair deal of hidden likely-subtag processing in calls to the constructor and bcp47Name(). Expand testing of QLocale::uiLanguages(), both plain and system. In the process, cross-link the two closely-related tests, move a comment on one's _data() to the other's, where it really belongs, and add reporting of the actual lists on failure. Enable MySystemLocale to remember the requested locale's ID, before likely sub-tag processing, so that we can make query() report results for language, script and territory as requested, to ensure the fake system locale really does match what was requested. The new german-britain test failed without it, because there is no de-GB locale in CLDR. Task-number: QTBUG-99531 Change-Id: Ide041577772c442a4413e3b9a590e11140c48f49 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.. | ||
syslocaleapp | ||
test | ||
.gitignore | ||
CMakeLists.txt | ||
tst_qlocale.cpp |