summaryrefslogtreecommitdiffstats
path: root/mkspecs/macx-clang/Info.plist.app
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-10-21 15:00:29 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-10-25 10:06:59 +0000
commit4709c938dba72b69a91b584bfe34010fec9e2d43 (patch)
tree853d30a71148efb6dcc23eecc08adaa79919e4a4 /mkspecs/macx-clang/Info.plist.app
parentfe0e76a5823851740f9bc69c768031cd63c9654c (diff)
Apple: Add CFBundleAllowMixedLocalizations=YES to Info.plist files
We currently don't have any machinery for qmake or CMake to map translations declared via TRANSLATIONS += or qt_add_translations to the Info.plist CFBundleLocalizations key. This results in macOS and iOS falling back to the development region, CFBundleDevelopmentRegion, as the only supported localization of the app, which is in most cases set to 'en'. Unfortunately this doesn't work well with the behavior of iOS 11+ and macOS 10.13+ where the OS will set the locale of the app to the best match between the app's supported localizations and the user's preferred language. https://developer.apple.com/library/archive/qa/qa1828/ Since we only support a single localization, the development region, the locale always ends up as 'en_<REGION>', which after QTBUG-104930 is also reflected in the QLocale's uiLanguages(), resulting in the QTranslator machinery always picking English translation for the app. As long as we don't explicitly declare CFBundleLocalizations we need to opt out of the system's behavior of finding the best match between the app's declared localizations and the user's preferences, which we can do via the CFBundleAllowMixedLocalizations key. Fixes: QTBUG-63324 Pick-to: 6.4 Change-Id: If7586d342148cbbb1d2a152cef039aad4448b13c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'mkspecs/macx-clang/Info.plist.app')
-rw-r--r--mkspecs/macx-clang/Info.plist.app2
1 files changed, 2 insertions, 0 deletions
diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app
index 9aca41b6dd..e37d8975f8 100644
--- a/mkspecs/macx-clang/Info.plist.app
+++ b/mkspecs/macx-clang/Info.plist.app
@@ -22,5 +22,7 @@
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <true/>
</dict>
</plist>