From d9461f348f10c038e4d0914fdcc7206c5cf48bb6 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 12 Aug 2018 23:29:26 +0800 Subject: [PATCH] Generate i18n .ts files in the correct directory Fixup 5b7c089dd2fce88017fcdc5911801fc809175c0d. Closes #9313. --- src/lang/lang.pri | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lang/lang.pri b/src/lang/lang.pri index e08a6a20a..30d5b7106 100644 --- a/src/lang/lang.pri +++ b/src/lang/lang.pri @@ -1,5 +1,10 @@ -TRANSLATIONS += $$files(qbittorrent_*.ts) -TS_IN_NOEXT = $$replace(TRANSLATIONS,".ts","") +TS_FILES += $$files(qbittorrent_*.ts) + +# need to use full path, otherwise running +# `lupdate` will generate *.ts files in project root directory +for(file, TS_FILES) { + TRANSLATIONS += "$${PWD}/$${file}" +} isEmpty(QMAKE_LRELEASE) { win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe @@ -14,8 +19,9 @@ isEmpty(QMAKE_LRELEASE) { } message("Building translations") -for(L,TS_IN_NOEXT) { - message("Processing $${L}") - system("$$QMAKE_LRELEASE -silent $${L}.ts -qm $${L}.qm") - !exists("$${L}.qm"):error("Building translations failed, cannot continue") +TS_FILES_NOEXT = $$replace(TS_FILES, ".ts", "") +for(file, TS_FILES_NOEXT) { + message("Processing $${file}") + system("$$QMAKE_LRELEASE -silent $${file}.ts -qm $${file}.qm") + !exists("$${file}.qm"):error("Building translations failed, cannot continue") }