From b387a6cd8aedf03e4445bbdf757398e85c041635 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Feb 2024 11:49:32 +0100 Subject: [PATCH] CMake: Rename I18N_*LANGUAGES variables and parameters ...according to the Qt 6.7 CMake API review. Pick-to: 6.7 Task-number: QTBUG-122396 Change-Id: I42012e346325ff05d63fa4dac44276eef15320fe Reviewed-by: Alexandru Croitor --- cmake/QtPublicAppleHelpers.cmake | 4 ++-- src/corelib/Qt6CoreMacros.cmake | 13 +++++++------ .../doc/src/cmake/cmake-configure-variables.qdoc | 12 ++++++------ .../doc/src/cmake/qt_standard_project_setup.qdoc | 12 ++++++------ 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/cmake/QtPublicAppleHelpers.cmake b/cmake/QtPublicAppleHelpers.cmake index 09e189fb384..294412d2e74 100644 --- a/cmake/QtPublicAppleHelpers.cmake +++ b/cmake/QtPublicAppleHelpers.cmake @@ -612,8 +612,8 @@ function(_qt_internal_set_apple_localizations target) return() endif() - set(supported_languages "${QT_I18N_LANGUAGES}") - if("${QT_I18N_LANGUAGES}" STREQUAL "") + set(supported_languages "${QT_I18N_TRANSLATED_LANGUAGES}") + if("${QT_I18N_TRANSLATED_LANGUAGES}" STREQUAL "") get_target_property(supported_languages "${target}" _qt_apple_supported_languages) if("${supported_languages}" STREQUAL "supported_languages-NOTFOUND") return() diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index f8a2754c452..887fd71734e 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -3197,10 +3197,10 @@ macro(qt6_standard_project_setup) set(__qt_sps_args_single REQUIRES SUPPORTS_UP_TO - I18N_NATIVE_LANGUAGE + I18N_SOURCE_LANGUAGE ) set(__qt_sps_args_multi - I18N_LANGUAGES + I18N_TRANSLATED_LANGUAGES ) cmake_parse_arguments(__qt_sps_arg "${__qt_sps_args_option}" @@ -3314,11 +3314,12 @@ macro(qt6_standard_project_setup) source_group("Source Files/Generated" REGULAR_EXPRESSION "(_metatypes\\.json)$") # I18N support. - if(DEFINED __qt_sps_arg_I18N_LANGUAGES AND NOT DEFINED QT_I18N_LANGUAGES) - set(QT_I18N_LANGUAGES ${__qt_sps_arg_I18N_LANGUAGES}) + if(DEFINED __qt_sps_arg_I18N_TRANSLATED_LANGUAGES + AND NOT DEFINED QT_I18N_TRANSLATED_LANGUAGES) + set(QT_I18N_TRANSLATED_LANGUAGES ${__qt_sps_arg_I18N_TRANSLATED_LANGUAGES}) endif() - if(DEFINED __qt_sps_arg_I18N_NATIVE_LANGUAGE AND NOT DEFINED QT_I18N_NATIVE_LANGUAGE) - set(QT_I18N_NATIVE_LANGUAGE ${__qt_sps_arg_I18N_NATIVE_LANGUAGE}) + if(DEFINED __qt_sps_arg_I18N_SOURCE_LANGUAGE AND NOT DEFINED QT_I18N_SOURCE_LANGUAGE) + set(QT_I18N_SOURCE_LANGUAGE ${__qt_sps_arg_I18N_SOURCE_LANGUAGE}) endif() endif() endmacro() diff --git a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc index 941d8195959..f1b87b7dce5 100644 --- a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc +++ b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc @@ -516,8 +516,8 @@ methods provided by CMake. \page cmake-variable-qt-i18n-languages.html \ingroup cmake-variables-qtcore -\title QT_I18N_LANGUAGES -\target cmake-variable-QT_I18N_LANGUAGES +\title QT_I18N_TRANSLATED_LANGUAGES +\target cmake-variable-QT_I18N_TRANSLATED_LANGUAGES \summary {List of languages to be used for project internationalization.} @@ -527,7 +527,7 @@ Specifies a list of languages that are used for project internationalization. The single languages must be compatible with the string-based \l QLocale constructor. -The languages in \c QT_I18N_LANGUAGES are used to: +The languages in \c QT_I18N_TRANSLATED_LANGUAGES are used to: \list \li Set up executable targets for consuming \c{.qm} files. \li Automatically construct \c{.ts} file names in @@ -545,8 +545,8 @@ This variable can be conveniently set with the \page cmake-variable-qt-i18n-native-language.html \ingroup cmake-variables-qtcore -\title QT_I18N_NATIVE_LANGUAGE -\target cmake-variable-QT_I18N_NATIVE_LANGUAGE +\title QT_I18N_SOURCE_LANGUAGE +\target cmake-variable-QT_I18N_SOURCE_LANGUAGE \summary {Specifies the language of translatable strings.} @@ -555,7 +555,7 @@ This variable can be conveniently set with the Specifies the language of translatable strings in the source code. The language must be compatible with the string-based \l QLocale constructor. -Together with \c{QT_I18N_LANGUAGES}, this variable is used to determine the +Together with \c{QT_I18N_TRANSLATED_LANGUAGES}, this variable is used to determine the names of \c{.ts} files for \l{qt6_add_translations}{qt_add_translations()}. This variable can be conveniently set with the diff --git a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc index e478148d2eb..f4366ac3557 100644 --- a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc +++ b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc @@ -20,8 +20,8 @@ qt_standard_project_setup( [REQUIRES ] [SUPPORTS_UP_TO ] - [I18N_LANGUAGES ] - [I18N_NATIVE_LANGUAGE ] + [I18N_TRANSLATED_LANGUAGES ] + [I18N_SOURCE_LANGUAGE ] ) \endcode @@ -86,11 +86,11 @@ setting the \l{QT_NO_STANDARD_PROJECT_SETUP} variable to true. \section1 Internationalization Since Qt 6.7, it is possible to specify the languages that are used for project -internationalization with the \c I18N_LANGUAGES argument. See \l -QT_I18N_LANGUAGES for details. +internationalization with the \c I18N_TRANSLATED_LANGUAGES argument. See \l +QT_I18N_TRANSLATED_LANGUAGES for details. -Use I18N_NATIVE_LANGUAGE to specify the native language that translatable -strings are written in. See \l QT_I18N_NATIVE_LANGUAGE for details. +Use I18N_SOURCE_LANGUAGE to specify the language that translatable strings are +written in. See \l QT_I18N_SOURCE_LANGUAGE for details. \section1 Example