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 <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2024-02-19 11:49:32 +01:00
parent f926ccbf64
commit b387a6cd8a
4 changed files with 21 additions and 20 deletions

View File

@ -612,8 +612,8 @@ function(_qt_internal_set_apple_localizations target)
return() return()
endif() endif()
set(supported_languages "${QT_I18N_LANGUAGES}") set(supported_languages "${QT_I18N_TRANSLATED_LANGUAGES}")
if("${QT_I18N_LANGUAGES}" STREQUAL "") if("${QT_I18N_TRANSLATED_LANGUAGES}" STREQUAL "")
get_target_property(supported_languages "${target}" _qt_apple_supported_languages) get_target_property(supported_languages "${target}" _qt_apple_supported_languages)
if("${supported_languages}" STREQUAL "supported_languages-NOTFOUND") if("${supported_languages}" STREQUAL "supported_languages-NOTFOUND")
return() return()

View File

@ -3197,10 +3197,10 @@ macro(qt6_standard_project_setup)
set(__qt_sps_args_single set(__qt_sps_args_single
REQUIRES REQUIRES
SUPPORTS_UP_TO SUPPORTS_UP_TO
I18N_NATIVE_LANGUAGE I18N_SOURCE_LANGUAGE
) )
set(__qt_sps_args_multi set(__qt_sps_args_multi
I18N_LANGUAGES I18N_TRANSLATED_LANGUAGES
) )
cmake_parse_arguments(__qt_sps_arg cmake_parse_arguments(__qt_sps_arg
"${__qt_sps_args_option}" "${__qt_sps_args_option}"
@ -3314,11 +3314,12 @@ macro(qt6_standard_project_setup)
source_group("Source Files/Generated" REGULAR_EXPRESSION "(_metatypes\\.json)$") source_group("Source Files/Generated" REGULAR_EXPRESSION "(_metatypes\\.json)$")
# I18N support. # I18N support.
if(DEFINED __qt_sps_arg_I18N_LANGUAGES AND NOT DEFINED QT_I18N_LANGUAGES) if(DEFINED __qt_sps_arg_I18N_TRANSLATED_LANGUAGES
set(QT_I18N_LANGUAGES ${__qt_sps_arg_I18N_LANGUAGES}) AND NOT DEFINED QT_I18N_TRANSLATED_LANGUAGES)
set(QT_I18N_TRANSLATED_LANGUAGES ${__qt_sps_arg_I18N_TRANSLATED_LANGUAGES})
endif() endif()
if(DEFINED __qt_sps_arg_I18N_NATIVE_LANGUAGE AND NOT DEFINED QT_I18N_NATIVE_LANGUAGE) if(DEFINED __qt_sps_arg_I18N_SOURCE_LANGUAGE AND NOT DEFINED QT_I18N_SOURCE_LANGUAGE)
set(QT_I18N_NATIVE_LANGUAGE ${__qt_sps_arg_I18N_NATIVE_LANGUAGE}) set(QT_I18N_SOURCE_LANGUAGE ${__qt_sps_arg_I18N_SOURCE_LANGUAGE})
endif() endif()
endif() endif()
endmacro() endmacro()

View File

@ -516,8 +516,8 @@ methods provided by CMake.
\page cmake-variable-qt-i18n-languages.html \page cmake-variable-qt-i18n-languages.html
\ingroup cmake-variables-qtcore \ingroup cmake-variables-qtcore
\title QT_I18N_LANGUAGES \title QT_I18N_TRANSLATED_LANGUAGES
\target cmake-variable-QT_I18N_LANGUAGES \target cmake-variable-QT_I18N_TRANSLATED_LANGUAGES
\summary {List of languages to be used for project internationalization.} \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 internationalization. The single languages must be compatible with the
string-based \l QLocale constructor. 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 \list
\li Set up executable targets for consuming \c{.qm} files. \li Set up executable targets for consuming \c{.qm} files.
\li Automatically construct \c{.ts} file names in \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 \page cmake-variable-qt-i18n-native-language.html
\ingroup cmake-variables-qtcore \ingroup cmake-variables-qtcore
\title QT_I18N_NATIVE_LANGUAGE \title QT_I18N_SOURCE_LANGUAGE
\target cmake-variable-QT_I18N_NATIVE_LANGUAGE \target cmake-variable-QT_I18N_SOURCE_LANGUAGE
\summary {Specifies the language of translatable strings.} \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. Specifies the language of translatable strings in the source code.
The language must be compatible with the string-based \l QLocale constructor. 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()}. names of \c{.ts} files for \l{qt6_add_translations}{qt_add_translations()}.
This variable can be conveniently set with the This variable can be conveniently set with the

View File

@ -20,8 +20,8 @@
qt_standard_project_setup( qt_standard_project_setup(
[REQUIRES <version>] [REQUIRES <version>]
[SUPPORTS_UP_TO <version>] [SUPPORTS_UP_TO <version>]
[I18N_LANGUAGES <language...>] [I18N_TRANSLATED_LANGUAGES <language...>]
[I18N_NATIVE_LANGUAGE <language>] [I18N_SOURCE_LANGUAGE <language>]
) )
\endcode \endcode
@ -86,11 +86,11 @@ setting the \l{QT_NO_STANDARD_PROJECT_SETUP} variable to true.
\section1 Internationalization \section1 Internationalization
Since Qt 6.7, it is possible to specify the languages that are used for project 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 internationalization with the \c I18N_TRANSLATED_LANGUAGES argument. See \l
QT_I18N_LANGUAGES for details. QT_I18N_TRANSLATED_LANGUAGES for details.
Use I18N_NATIVE_LANGUAGE to specify the native language that translatable Use I18N_SOURCE_LANGUAGE to specify the language that translatable strings are
strings are written in. See \l QT_I18N_NATIVE_LANGUAGE for details. written in. See \l QT_I18N_SOURCE_LANGUAGE for details.
\section1 Example \section1 Example