diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2024-02-19 11:54:55 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-02-26 06:08:08 +0000 |
commit | d2255ade34e3460e4e4ad76cf40ee6af8dc26fad (patch) | |
tree | 6bd426022354909cf6950ce561588d6ff7279fc5 | |
parent | 1da1d4ee2b01fae4d881f330f5c85d2e8c6d8092 (diff) |
CMake: Rename I18N_*LANGUAGES variables and parameters
...according to the Qt 6.7 CMake API review.
Task-number: QTBUG-122396
Change-Id: Ica4e6ae91ee708ccb0890d8d32fd1a9fd2bf8d29
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c3b2bde9086f4d9ee27ffdc6ab753f2946cedf60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
9 files changed, 29 insertions, 29 deletions
diff --git a/examples/linguist/arrowpad/CMakeLists.txt b/examples/linguist/arrowpad/CMakeLists.txt index 199e09c59..9424dc9d9 100644 --- a/examples/linguist/arrowpad/CMakeLists.txt +++ b/examples/linguist/arrowpad/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) #! [0] find_package(Qt6 REQUIRED COMPONENTS LinguistTools) -qt_standard_project_setup(I18N_LANGUAGES fr nl) +qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES fr nl) #! [0] qt_add_executable(arrowpad diff --git a/examples/linguist/hellotr/CMakeLists.txt b/examples/linguist/hellotr/CMakeLists.txt index 89169bacc..fe3325377 100644 --- a/examples/linguist/hellotr/CMakeLists.txt +++ b/examples/linguist/hellotr/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) #! [0] find_package(Qt6 REQUIRED COMPONENTS LinguistTools) -qt_standard_project_setup(I18N_LANGUAGES la) +qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES la) #! [0] qt_add_executable(hellotr diff --git a/examples/linguist/i18n/CMakeLists.txt b/examples/linguist/i18n/CMakeLists.txt index 9512bf9f9..351e0e850 100644 --- a/examples/linguist/i18n/CMakeLists.txt +++ b/examples/linguist/i18n/CMakeLists.txt @@ -15,7 +15,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n") find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets LinguistTools) qt_standard_project_setup( - I18N_LANGUAGES ar cs de el en eo fr it ja ko nb ru sv zh + I18N_TRANSLATED_LANGUAGES ar cs de el en eo fr it ja ko nb ru sv zh ) qt_add_executable(i18n diff --git a/examples/linguist/trollprint/CMakeLists.txt b/examples/linguist/trollprint/CMakeLists.txt index e45920831..fab9a3967 100644 --- a/examples/linguist/trollprint/CMakeLists.txt +++ b/examples/linguist/trollprint/CMakeLists.txt @@ -14,7 +14,7 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) find_package(Qt6 REQUIRED COMPONENTS LinguistTools) -qt_standard_project_setup(I18N_LANGUAGES pt) +qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES pt) qt_add_executable(trollprint main.cpp diff --git a/src/linguist/Qt6LinguistToolsMacros.cmake b/src/linguist/Qt6LinguistToolsMacros.cmake index d753a3a37..b0dc6f0fc 100644 --- a/src/linguist/Qt6LinguistToolsMacros.cmake +++ b/src/linguist/Qt6LinguistToolsMacros.cmake @@ -567,10 +567,10 @@ function(qt6_add_translations) endif() if(NOT DEFINED arg_TS_FILES AND NOT DEFINED arg_NATIVE_TS_FILE - AND "${QT_I18N_LANGUAGES}" STREQUAL "" - AND "${QT_I18N_NATIVE_LANGUAGE}" STREQUAL "") + AND "${QT_I18N_TRANSLATED_LANGUAGES}" STREQUAL "" + AND "${QT_I18N_SOURCE_LANGUAGE}" STREQUAL "") message(FATAL_ERROR - "One of QT_I18N_LANGUAGES, QT_I18N_NATIVE_LANGUAGE, TS_FILES, " + "One of QT_I18N_TRANSLATED_LANGUAGES, QT_I18N_SOURCE_LANGUAGE, TS_FILES, " "or NATIVE_TS_FILE must be provided.") endif() if(DEFINED arg_RESOURCE_PREFIX AND DEFINED arg_QM_FILES_OUTPUT_VARIABLE) @@ -595,14 +595,14 @@ function(qt6_add_translations) string(REPLACE " " "-" arg_TS_FILE_BASE "${arg_TS_FILE_BASE}") endif() set(arg_TS_FILES "") - foreach(lang IN LISTS QT_I18N_LANGUAGES) + foreach(lang IN LISTS QT_I18N_TRANSLATED_LANGUAGES) list(APPEND arg_TS_FILES "${arg_TS_FILE_DIR}/${arg_TS_FILE_BASE}_${lang}.ts") endforeach() # Determine the path to the native .ts file if necessary. - if(NOT DEFINED arg_NATIVE_TS_FILE AND NOT "${QT_I18N_NATIVE_LANGUAGE}" STREQUAL "") + if(NOT DEFINED arg_NATIVE_TS_FILE AND NOT "${QT_I18N_SOURCE_LANGUAGE}" STREQUAL "") set(arg_NATIVE_TS_FILE - "${arg_TS_FILE_DIR}/${arg_TS_FILE_BASE}_${QT_I18N_NATIVE_LANGUAGE}.ts") + "${arg_TS_FILE_DIR}/${arg_TS_FILE_BASE}_${QT_I18N_SOURCE_LANGUAGE}.ts") endif() endif() @@ -699,7 +699,7 @@ function(qt6_add_translations) QM_FILES_OUTPUT_VARIABLE qm_files OPTIONS "${arg_LRELEASE_OPTIONS}") - if("${QT_I18N_LANGUAGES}" STREQUAL "") + if("${QT_I18N_TRANSLATED_LANGUAGES}" STREQUAL "") _qt_internal_store_languages_from_ts_files_in_targets("${targets}" "${arg_TS_FILES}") endif() diff --git a/src/linguist/linguist/doc/cmake-macros.qdoc b/src/linguist/linguist/doc/cmake-macros.qdoc index aec089f40..20c9964c7 100644 --- a/src/linguist/linguist/doc/cmake-macros.qdoc +++ b/src/linguist/linguist/doc/cmake-macros.qdoc @@ -405,7 +405,7 @@ details. \section1 Automatic Determination of .ts File Paths The paths of the \c{.ts} files that are used as input for \c qt_add_translations -can be automatically determined if \l{QT_I18N_LANGUAGES} has been set. +can be automatically determined if \l{QT_I18N_TRANSLATED_LANGUAGES} has been set. The following project setup is usually enough: @@ -423,7 +423,7 @@ can specify a different base name with the \c{TS_FILE_BASE} argument. \include cmake-macros.qdoc ts-native-language -If \l{QT_I18N_NATIVE_LANGUAGE} is set then the path to the native \c{.ts} file +If \l{QT_I18N_SOURCE_LANGUAGE} is set then the path to the native \c{.ts} file will also be automatically determined. \section1 Options diff --git a/src/linguist/linguist/doc/snippets/cmake-macros/examples.cmake b/src/linguist/linguist/doc/snippets/cmake-macros/examples.cmake index 2a3239a7e..0cc5211f4 100644 --- a/src/linguist/linguist/doc/snippets/cmake-macros/examples.cmake +++ b/src/linguist/linguist/doc/snippets/cmake-macros/examples.cmake @@ -18,7 +18,7 @@ qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} helloworld_en.ts helloworld_d #! [auto_determine_ts_file_paths] project(myproject) cmake_minimum_required(VERSION 3.19) -qt_standard_project_setup(I18N_LANGUAGES de fr) +qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES de fr) add_subdirectory(libs) add_subdirectory(apps) diff --git a/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/CMakeLists.txt b/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/CMakeLists.txt index b7767bd90..08507388f 100644 --- a/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/CMakeLists.txt +++ b/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/CMakeLists.txt @@ -24,7 +24,7 @@ set(expected_files "") # Check defaults for the deferred call. my_add_library(lib1 STATIC lib.cpp) -set(QT_I18N_LANGUAGES te st) +set(QT_I18N_TRANSLATED_LANGUAGES te st) qt_add_translations(TARGETS lib1) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/test_i18n_auto_ts_file_names_en.ts" # plurals-only file @@ -33,8 +33,8 @@ list(APPEND expected_files # Check defaults for the immediate call. my_add_library(lib2 STATIC lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE hu) -set(QT_I18N_LANGUAGES hi ho) +set(QT_I18N_SOURCE_LANGUAGE hu) +set(QT_I18N_TRANSLATED_LANGUAGES hi ho) qt_add_translations(TARGETS lib2 IMMEDIATE_CALL) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/test_i18n_auto_ts_file_names_hu.ts" # plurals-only file @@ -52,8 +52,8 @@ list(APPEND expected_files # Check whether TS_FILE_BASE works. my_add_library(lib5 STATIC lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE ne) -set(QT_I18N_LANGUAGES no) +set(QT_I18N_SOURCE_LANGUAGE ne) +set(QT_I18N_TRANSLATED_LANGUAGES no) qt_add_translations(TARGETS lib5 TS_FILE_BASE lib5) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/lib5_ne.ts" # plurals-only file @@ -61,16 +61,16 @@ list(APPEND expected_files # Check whether TS_FILE_DIR works. my_add_library(lib6 STATIC lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE so) # plurals-only file -set(QT_I18N_LANGUAGES sv) +set(QT_I18N_SOURCE_LANGUAGE so) # plurals-only file +set(QT_I18N_TRANSLATED_LANGUAGES sv) qt_add_translations(TARGETS lib6 TS_FILE_DIR translations) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/translations/test_i18n_auto_ts_file_names_sv.ts") # Check whether TS_FILE_BASE and TS_FILE_DIR work together. my_add_library(lib7 STATIC lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE fy) -set(QT_I18N_LANGUAGES fi) +set(QT_I18N_SOURCE_LANGUAGE fy) +set(QT_I18N_TRANSLATED_LANGUAGES fi) qt_add_translations(TARGETS lib7 TS_FILE_BASE lib7 TS_FILE_DIR translations) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/translations/lib7_fy.ts" # plurals-only file @@ -78,8 +78,8 @@ list(APPEND expected_files # Check defaults for the deferred call with just the native language set. my_add_library(lib8 STATIC lib.cpp) -set(QT_I18N_LANGUAGES "") -set(QT_I18N_NATIVE_LANGUAGE nl) +set(QT_I18N_TRANSLATED_LANGUAGES "") +set(QT_I18N_SOURCE_LANGUAGE nl) qt_add_translations(TARGETS lib8) list(APPEND expected_files "${CMAKE_CURRENT_SOURCE_DIR}/test_i18n_auto_ts_file_names_nl.ts") diff --git a/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/subdir/CMakeLists.txt b/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/subdir/CMakeLists.txt index 26f9f71b0..2fcc3cc03 100644 --- a/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/subdir/CMakeLists.txt +++ b/tests/auto/cmake/linguist/test_i18n_auto_ts_file_names/subdir/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: BSD-3-Clause my_add_library(lib3 STATIC ../lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE eo) -set(QT_I18N_LANGUAGES de) +set(QT_I18N_SOURCE_LANGUAGE eo) +set(QT_I18N_TRANSLATED_LANGUAGES de) qt_add_translations(TARGETS lib3) my_add_library(lib4 STATIC ../lib.cpp) -set(QT_I18N_NATIVE_LANGUAGE ee) -set(QT_I18N_LANGUAGES da) +set(QT_I18N_SOURCE_LANGUAGE ee) +set(QT_I18N_TRANSLATED_LANGUAGES da) qt_add_translations(TARGETS lib4 IMMEDIATE_CALL) |