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:
parent
f926ccbf64
commit
b387a6cd8a
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -20,8 +20,8 @@
|
||||
qt_standard_project_setup(
|
||||
[REQUIRES <version>]
|
||||
[SUPPORTS_UP_TO <version>]
|
||||
[I18N_LANGUAGES <language...>]
|
||||
[I18N_NATIVE_LANGUAGE <language>]
|
||||
[I18N_TRANSLATED_LANGUAGES <language...>]
|
||||
[I18N_SOURCE_LANGUAGE <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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user