diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-06-13 16:19:19 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-14 13:45:18 +0000 |
commit | 2b8938edeb59bf7b37ba6e2d702c6877d15f4b99 (patch) | |
tree | 9ec6dbfda6f48015af1aa1b36f31ab4e960d88f2 /qmake | |
parent | 12b1ec4b309ffe43cb89e2fe06835d0b04bdffb6 (diff) |
qmake: Document Xcode behavior when bundling translation files
Xcode's legacy and new build system modes have different behavior
in how they bundle resource paths that start with lang_code.lproj.
Document how to bundle translation files for both legacy
and new build systems.
Fixes: QTBUG-98417
Change-Id: I857ec76577f8244a751d4bf38fbe305fef614734
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 94207621ee768ddedf0021aef99566a8ce90d22b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/doc/qmake.qdocconf | 2 | ||||
-rw-r--r-- | qmake/doc/snippets/code/doc_src_qmake-manual.pro | 17 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 27 |
3 files changed, 46 insertions, 0 deletions
diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf index f3e5c1920a..f0ab617801 100644 --- a/qmake/doc/qmake.qdocconf +++ b/qmake/doc/qmake.qdocconf @@ -24,6 +24,8 @@ exampledirs = snippets tagfile = qmake.tags +macro.qtbug = "\\l{https://bugreports.qt.io/browse/\1}{\1}" + depends += \ activeqt \ qt3d \ diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro index e82799c5bf..76f0eec2fe 100644 --- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro +++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro @@ -944,3 +944,20 @@ win32-g++:contains(QMAKE_HOST.arch, x86_64):{ ... } #! [187] + +#! [188] +translations_en.files = $$PWD/en.lproj/InfoPlist.strings +translations_en.path = en.lproj +QMAKE_BUNDLE_DATA += translations_en +#! [188] + +#! [189] +# Approach 1 +translations_en.files = $$PWD/InfoPlist.strings +translations_en.path = en.lproj + +# Approach 2 +translations_de.files = $$PWD/de.lproj/InfoPlist.strings + +QMAKE_BUNDLE_DATA += translations_en translations_de +#! [189] diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index a8002d816e..6255e0e451 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1876,6 +1876,33 @@ See \l{Platform Notes#Creating Frameworks}{Platform Notes} for more information about creating library bundles. + A project can also use this variable to bundle application translation + files. The exact syntax depends on whether the project is using Xcode's + legacy build system or its new build system. + + For example when the following project snippet is built using the + legacy build system: + + \snippet code/doc_src_qmake-manual.pro 188 + + Xcode will ignore the original location of \c InfoPlist.strings + and the file will placed into the bundle \c Resources directory + under the provided \c translations_en.path path, so + \c Resources/en.lproj/InfoPlist.strings + + With the new build system, the relative location of the file is + preserved, which means the file will incorrectly be placed under + \c Resources/en.lproj/en.lproj/InfoPlist.strings + + To ensure correct file placement, the project can either move + the original file not to be in a sub-directory or it can choose + not to specify the \c translations_en.path variable. + + \snippet code/doc_src_qmake-manual.pro 189 + + See \qtbug QTBUG-98417 for more details on how the Xcode build + system changed its behavior in bundling translation files. + \section1 QMAKE_BUNDLE_EXTENSION \note This variable is used on \macos, iOS, tvOS, and watchOS only. |