1From ba5e586843477932e8ae1b48c0d977a7cac8ede6 Mon Sep 17 00:00:00 2001
2From: Andy Shaw <andy.shaw@qt.io>
3Date: Thu, 23 Apr 2020 18:47:17 +0300
4Subject: [PATCH 3/3] Fix QLocale::system() and uiLanguages() for the mobile
5 platforms
6
7On iOS, it was no longer using the Cocoa specific code needed to get
8the locale and uiLanguages information so this functionality is brought
9back as it was accidently lost.
10
11In addition, this has a side-effect of fixing a problem with Android
12versions below API 24 where it has no UiLanguages functionality so it
13gets the information based on the system locale as a fallback.
14
15Fixes: QTBUG-81307
16Fixes: QTBUG-81357
17Change-Id: I1709675b5bd5e9cedefb99eaec28279f20a347a4
18Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
19---
20 src/corelib/tools/qlocale.cpp | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
24index c0ca41826f..e29325d8e5 100644
25--- a/src/corelib/tools/qlocale.cpp
26+++ b/src/corelib/tools/qlocale.cpp
27@@ -4000,6 +4000,8 @@ QStringList QLocale::uiLanguages() const
28             for (const auto entry : qAsConst(uiLanguages))
29                 locales.append(QLocale(entry));
30         }
31+        if (locales.isEmpty())
32+            locales.append(systemLocale()->fallbackUiLocale());
33     } else
34 #endif
35     {
36--
372.20.1.windows.1
38
39