summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-04-17 17:10:41 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-04-20 12:08:05 +0000
commitc90c73682583842aa8af83a59a6473b456258ec5 (patch)
tree1c3ae39240a03aa089dfb76d7881fa24e848983c
parent8415056fb59455635adb1308e9778ac3b556d002 (diff)
downloadqtdoc-c90c73682583842aa8af83a59a6473b456258ec5.tar.gz
Document how macOS chooses the locale and languages for an application
Task-number: QTBUG-104930 Change-Id: Ia1c4421df00bdb28cda4aa5eacc20f768f4ef579 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c4357b304dc7f06ce7fd22112c977b12e8d6bcb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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