From fbdd858fbd15d29b41a9b773096abb56604146e1 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sat, 26 Apr 2025 17:02:24 +0800 Subject: [PATCH] chore: merge Qt translations into app translations as well --- CMakeLists.txt | 10 ++++++++-- .../{PineapplePictures.ts => PineapplePictures_en.ts} | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) rename app/translations/{PineapplePictures.ts => PineapplePictures_en.ts} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd04419..95af188 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,10 +118,16 @@ add_executable (${EXE_NAME} ) if (${QT_VERSION_MAJOR} EQUAL "6") + set(ADD_TRANSLATIONS_ADDITIONAL_ARGS) + + if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0") + set(ADD_TRANSLATIONS_ADDITIONAL_ARGS MERGE_QT_TRANSLATIONS) + endif() + if (TRANSLATION_RESOURCE_EMBEDDING) - qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES}) + qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES}) else() - qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES) + qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES) endif() else() qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) diff --git a/app/translations/PineapplePictures.ts b/app/translations/PineapplePictures_en.ts similarity index 99% rename from app/translations/PineapplePictures.ts rename to app/translations/PineapplePictures_en.ts index bfc1e38..3450f2e 100644 --- a/app/translations/PineapplePictures.ts +++ b/app/translations/PineapplePictures_en.ts @@ -1,6 +1,6 @@ - + AboutDialog