From 972046ff79ab78c776370099d2d814b97b4fc32a Mon Sep 17 00:00:00 2001 From: Nikita Zimin Date: Fri, 19 Jan 2024 22:38:31 +0300 Subject: [PATCH] Prepare translation files on build --- .github/workflows/push-matrix.yml | 1 - .gitignore | 9 ++++++--- emulator/QtUkncBtl.pro | 10 +++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push-matrix.yml b/.github/workflows/push-matrix.yml index 10b2e4b..8c53581 100644 --- a/.github/workflows/push-matrix.yml +++ b/.github/workflows/push-matrix.yml @@ -53,6 +53,5 @@ jobs: QMAKESPEC: ${{ matrix.config.qmakespec }} run: | cd emulator - lrelease QtUkncBtl.pro qmake "CONFIG+=debug" QtUkncBtl.pro make diff --git a/.gitignore b/.gitignore index 69d0271..b7b7a64 100644 --- a/.gitignore +++ b/.gitignore @@ -17,17 +17,20 @@ /emulator/Makefile /emulator/object_script.* /emulator/lang/*.qm +Makefile moc_*.cpp moc_*.h qrc_*.cpp ui_*.h /emulator/.qtc_clangd/* -/emulator/.qmake.cache -/emulator/.qmake.stash +/emulator/.qm +.qmake.cache +.qmake.stash +*.json *.user .autosave /emulator/QtUkncBtl -/emulator/QtUkncBtl.app +QtUkncBtl.app /emulator/trace.log *.dsk /x-* diff --git a/emulator/QtUkncBtl.pro b/emulator/QtUkncBtl.pro index a1d52cb..cd093a4 100644 --- a/emulator/QtUkncBtl.pro +++ b/emulator/QtUkncBtl.pro @@ -55,7 +55,15 @@ QT += script QT += testlib QT += multimedia DEFINES -= UNICODE _UNICODE -TRANSLATIONS = lang/ukncbtl_en.ts lang/ukncbtl_ru.ts CONFIG += c++11 QMAKE_CXXFLAGS += -std=c++11 ICON = images/ukncbtl.icns + +TS_FILES = $$files(lang/*.ts, false) +lrelease.name = LRELEASE ${QMAKE_FILE_IN} +lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm lang/${QMAKE_FILE_BASE}.qm +lrelease.output = ${QMAKE_FILE_BASE}.qm +lrelease.input = TS_FILES +lrelease.clean = lang/${QMAKE_FILE_BASE}.qm +lrelease.CONFIG += no_link target_predeps +QMAKE_EXTRA_COMPILERS += lrelease