Use independent translation for WebUI

This commit is contained in:
Vladimir Golovnev (Glassez)
2018-06-07 20:07:28 +03:00
parent becb002d87
commit c1a4ef1377
60 changed files with 92461 additions and 178 deletions

View File

@@ -10,7 +10,6 @@ HEADERS += \
$$PWD/api/torrentscontroller.h \
$$PWD/api/transfercontroller.h \
$$PWD/api/serialize/serialize_torrent.h \
$$PWD/extra_translations.h \
$$PWD/webapplication.h \
$$PWD/webui.h
@@ -29,3 +28,25 @@ SOURCES += \
$$PWD/webui.cpp
RESOURCES += $$PWD/www/webui.qrc
# WebUI Translation
isEmpty(QMAKE_LRELEASE) {
win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease.exe
else: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
equals(QT_MAJOR_VERSION, 5) {
!exists($$QMAKE_LRELEASE): QMAKE_LRELEASE = lrelease-qt5
}
}
else {
!exists($$QMAKE_LRELEASE): QMAKE_LRELEASE = lrelease
}
}
WEBUI_TRANSLATIONS = $$files(www/translations/webui_*.ts)
WEBUI_TRANSLATIONS_NOEXT = $$replace(WEBUI_TRANSLATIONS, ".ts", "")
message("Building WebUI translations...")
for(L, WEBUI_TRANSLATIONS_NOEXT) {
message("Processing $${L}")
system("$$QMAKE_LRELEASE -silent $${L}.ts -qm $${L}.qm")
!exists("$${L}.qm"): error("Building WebUI translations failed, cannot continue!")
}