From 49cd7a62104b437c669200d3159c0fcb18c20698 Mon Sep 17 00:00:00 2001 From: David Helkowski Date: Thu, 22 Jan 2026 14:37:11 +0900 Subject: [PATCH] Add verbose option for translation generation in CMake configuration This commit introduces a new option, TRANSLATIONS_VERBOSE, to the CMakeLists.txt file, allowing users to enable verbose output during the generation of .qm translation files. The qt_add_lrelease command is modified to conditionally include the -silent option based on the value of TRANSLATIONS_VERBOSE, improving the build process for translations. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5fa98170..3cd1f2329 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1529,10 +1529,15 @@ if(HAVE_DISCORD_RPC) endif() if(HAVE_TRANSLATIONS) + option(TRANSLATIONS_VERBOSE "Show verbose output while generating .qm translation files" OFF) qt_add_lupdate(strawberry_lib TS_FILES "${CMAKE_SOURCE_DIR}/src/translations/strawberry_en_US.ts" OPTIONS -locations none -no-ui-lines -no-obsolete) file(GLOB_RECURSE ts_files ${CMAKE_SOURCE_DIR}/src/translations/*.ts) set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/data") - qt_add_lrelease(strawberry TS_FILES ${ts_files} QM_FILES_OUTPUT_VARIABLE INSTALL_TRANSLATIONS_FILES) + if(TRANSLATIONS_VERBOSE) + qt_add_lrelease(strawberry TS_FILES ${ts_files} QM_FILES_OUTPUT_VARIABLE INSTALL_TRANSLATIONS_FILES) + else() + qt_add_lrelease(strawberry TS_FILES ${ts_files} QM_FILES_OUTPUT_VARIABLE INSTALL_TRANSLATIONS_FILES OPTIONS -silent) + endif() if(NOT INSTALL_TRANSLATIONS) qt_add_resources(strawberry "translations" PREFIX "/i18n" BASE "${CMAKE_CURRENT_BINARY_DIR}/data" FILES "${INSTALL_TRANSLATIONS_FILES}") endif()