summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-04-17 17:10:41 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-04-20 13:43:27 +0200
commitc4357b304dc7f06ce7fd22112c977b12e8d6bcb6 (patch)
tree3b69e7c015685ef5e09e90e63eb5d78f8a61fa9f
parentca84477e48942fa3a6bcc1751d60889d736211f8 (diff)
downloadqtdoc-c4357b304dc7f06ce7fd22112c977b12e8d6bcb6.tar.gz
Document how macOS chooses the locale and languages for an application
Pick-to: 6.5 Task-number: QTBUG-104930 Change-Id: Ia1c4421df00bdb28cda4aa5eacc20f768f4ef579 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--doc/src/platforms/macos.qdoc21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/src/platforms/macos.qdoc b/doc/src/platforms/macos.qdoc
index 4f2e3498..364337d1 100644
--- a/doc/src/platforms/macos.qdoc
+++ b/doc/src/platforms/macos.qdoc
@@ -429,6 +429,27 @@
mouse clicks, and maps to a control-click with the \macos one-button mouse
support.
+ \section1 Internationalization
+
+ Applications on \macos declare their supported languages as part of the
+ \c Info.plist of the application. The system will then match the application's
+ supported languages with the user's language preferences to determine the locale
+ the application is launched in. This in turn determines the ordered languages
+ reflected through QLocale::uiLanguages(), and how system frameworks such as
+ AppKit pick up their localized resources, such as menu titles and strings.
+
+ As Qt apps are not translated out of the box, the default generated \c Info.plist
+ for \c CMake and \c qmake projects sets
+ \l{https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleallowmixedlocalizations?language=objc}
+ {\c CFBundleAllowMixedLocalizations} to \c YES, to allow system frameworks to pick
+ the localization that best matches the user's language preferences, even if that
+ localization is not available for the application itself. Once you add translations
+ to your application, via e.g. \l qt_add_translations, you should remove
+ \l{https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleallowmixedlocalizations?language=objc}
+ {\c CFBundleAllowMixedLocalizations}
+ and replace it with \l{https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundlelocalizations?language=objc}
+ {\c CFBundleLocalizations}, listing all the languages you support.
+
\section1 Menu Bar
Qt detects menu bars and turns them into Mac native menu bars. Fitting this