diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-06-13 16:19:19 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-06-14 15:45:06 +0200 |
commit | 94207621ee768ddedf0021aef99566a8ce90d22b (patch) | |
tree | ab19fe2aa63b149454e1ad4f962b9676692f8688 /qmake | |
parent | 9dced35b41882c42f4239a6380bd86dfda4cd7f5 (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.
Pick-to: 5.15 6.2 6.3 6.4
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>
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. |