diff --git a/avahimonitor/avahimonitor.pro b/avahimonitor/avahimonitor.pro index 5d24f3aa..d58a2c2f 100644 --- a/avahimonitor/avahimonitor.pro +++ b/avahimonitor/avahimonitor.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginavahimonitor) diff --git a/awattar/awattar.pro b/awattar/awattar.pro index 4f815865..fb9be0fa 100644 --- a/awattar/awattar.pro +++ b/awattar/awattar.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginawattar) diff --git a/commandlauncher/commandlauncher.pro b/commandlauncher/commandlauncher.pro index 05305315..9955aa64 100644 --- a/commandlauncher/commandlauncher.pro +++ b/commandlauncher/commandlauncher.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugincommandlauncher) diff --git a/conrad/conrad.pro b/conrad/conrad.pro index a7764b8f..eb2801e7 100644 --- a/conrad/conrad.pro +++ b/conrad/conrad.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginconrad) diff --git a/datetime/datetime.pro b/datetime/datetime.pro index e24e5309..944d8e43 100644 --- a/datetime/datetime.pro +++ b/datetime/datetime.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugindatetime) diff --git a/denon/denon.pro b/denon/denon.pro index 7dc320f3..3b902e55 100644 --- a/denon/denon.pro +++ b/denon/denon.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugindenon) diff --git a/elgato/elgato.pro b/elgato/elgato.pro index d2b5064a..66c85847 100644 --- a/elgato/elgato.pro +++ b/elgato/elgato.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginelgato) diff --git a/elro/elro.pro b/elro/elro.pro index 7e481bb2..7c9ec86a 100644 --- a/elro/elro.pro +++ b/elro/elro.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginelro) diff --git a/eq-3/eq-3.pro b/eq-3/eq-3.pro index 3648195f..f828738f 100644 --- a/eq-3/eq-3.pro +++ b/eq-3/eq-3.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugineq3) diff --git a/genericelements/genericelements.pro b/genericelements/genericelements.pro index 9fa63c27..ed91a3cf 100644 --- a/genericelements/genericelements.pro +++ b/genericelements/genericelements.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugingenericelements) diff --git a/gpio/gpio.pro b/gpio/gpio.pro index fd500dbf..0556e7ce 100644 --- a/gpio/gpio.pro +++ b/gpio/gpio.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugingpio) diff --git a/guh-plugins.pro b/guh-plugins.pro index 3e46678f..f90ff2d8 100644 --- a/guh-plugins.pro +++ b/guh-plugins.pro @@ -39,6 +39,17 @@ CONFIG+=all message(============================================) message("Qt version:" $$[QT_VERSION]) +# Translations: +# make lupdate to update .ts files +lupdate.depends = FORCE +for (entry, PLUGIN_DIRS):lupdate.commands += make -C $${entry} lupdate; +QMAKE_EXTRA_TARGETS += lupdate + +# make lrelease to build .qm from .ts +lrelease.depends = FORCE +for (entry, PLUGIN_DIRS):lrelease.commands += $$[QT_INSTALL_BINS]/lrelease $$files($$PWD/$${entry}/translations/*.ts, true); +QMAKE_EXTRA_TARGETS += lrelease + # Verify if building only a selection of plugins contains(CONFIG, selection) { CONFIG-=all diff --git a/intertechno/intertechno.pro b/intertechno/intertechno.pro index d181e2d7..5ce9fbdb 100644 --- a/intertechno/intertechno.pro +++ b/intertechno/intertechno.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginintertechno) diff --git a/kodi/kodi.pro b/kodi/kodi.pro index beeafec7..32924116 100644 --- a/kodi/kodi.pro +++ b/kodi/kodi.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginkodi) diff --git a/leynew/leynew.pro b/leynew/leynew.pro index 259cfecf..8e796032 100644 --- a/leynew/leynew.pro +++ b/leynew/leynew.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginleynew) diff --git a/lgsmarttv/lgsmarttv.pro b/lgsmarttv/lgsmarttv.pro index 2474b37a..1fb2ea89 100644 --- a/lgsmarttv/lgsmarttv.pro +++ b/lgsmarttv/lgsmarttv.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginlgsmarttv) diff --git a/mailnotification/mailnotification.pro b/mailnotification/mailnotification.pro index af7fce92..3e778bda 100644 --- a/mailnotification/mailnotification.pro +++ b/mailnotification/mailnotification.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginmailnotification) diff --git a/netatmo/netatmo.pro b/netatmo/netatmo.pro index 8dc6be75..73f4765a 100644 --- a/netatmo/netatmo.pro +++ b/netatmo/netatmo.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginnetatmo) diff --git a/networkdetector/networkdetector.pro b/networkdetector/networkdetector.pro index c8ac62a8..e1ef5d8e 100644 --- a/networkdetector/networkdetector.pro +++ b/networkdetector/networkdetector.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginnetworkdetector) diff --git a/openweathermap/openweathermap.pro b/openweathermap/openweathermap.pro index ca238aa1..2bfee45a 100644 --- a/openweathermap/openweathermap.pro +++ b/openweathermap/openweathermap.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginopenweathermap) diff --git a/orderbutton/orderbutton.pro b/orderbutton/orderbutton.pro index b5e98d76..2c41e23b 100644 --- a/orderbutton/orderbutton.pro +++ b/orderbutton/orderbutton.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginorderbutton) diff --git a/osdomotics/osdomotics.pro b/osdomotics/osdomotics.pro index aba6a44c..7b73f3e3 100644 --- a/osdomotics/osdomotics.pro +++ b/osdomotics/osdomotics.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginosdomotics) diff --git a/philipshue/philipshue.pro b/philipshue/philipshue.pro index 6135bcfb..895096a4 100644 --- a/philipshue/philipshue.pro +++ b/philipshue/philipshue.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginphilipshue) diff --git a/plantcare/plantcare.pro b/plantcare/plantcare.pro index d42b8f1a..ba9aeebb 100644 --- a/plantcare/plantcare.pro +++ b/plantcare/plantcare.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginplantcare) diff --git a/plugins.pri b/plugins.pri index ad3f716d..2f142ef2 100644 --- a/plugins.pri +++ b/plugins.pri @@ -8,6 +8,8 @@ QMAKE_LFLAGS += -std=c++11 INCLUDEPATH += /usr/include/guh LIBS += -lguh +HEADERS += $${OUT_PWD}/plugininfo.h + PLUGIN_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/guh/plugins/ @@ -26,10 +28,7 @@ plugininfo.commands = touch ${QMAKE_FILE_OUT}; guh-generateplugininfo \ --filetype i \ --jsonfile ${QMAKE_FILE_NAME} \ --output ${QMAKE_FILE_OUT} \ - --builddir $$OUT_PWD \ - --translations $$TRANSLATIONS; \ - mkdir -p $$shadowed($$PWD)/translations/ || true; \ - rsync -a "$$OUT_PWD"/translations/*.qm $$shadowed($$PWD)/translations/; + --builddir $$OUT_PWD; PRE_TARGETDEPS += compiler_plugininfo_make_all QMAKE_EXTRA_COMPILERS += plugininfo @@ -41,13 +40,17 @@ externplugininfo.commands = touch ${QMAKE_FILE_OUT}; guh-generateplugininfo \ --filetype e \ --jsonfile ${QMAKE_FILE_NAME} \ --output ${QMAKE_FILE_OUT} \ - --builddir $$OUT_PWD \ - --translations $$TRANSLATIONS; + --builddir $$OUT_PWD; PRE_TARGETDEPS += compiler_externplugininfo_make_all QMAKE_EXTRA_COMPILERS += externplugininfo - # Install translation files +TRANSLATIONS *= $$files($${PWD}/$${TARGET}/translations/*ts, true) +lupdate.depends = FORCE +lupdate.depends += plugininfo +lupdate.commands = $$[QT_INSTALL_BINS]/lupdate -recursive -no-obsolete $$PWD/"$$TARGET"/"$$TARGET".pro; +QMAKE_EXTRA_TARGETS += lupdate + translations.path = /usr/share/guh/translations translations.files = $$[QT_SOURCE_TREE]/translations/*.qm diff --git a/senic/senic.pro b/senic/senic.pro index bc8ddb4b..21e679f3 100644 --- a/senic/senic.pro +++ b/senic/senic.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginsenic) diff --git a/snapd/snapd.pro b/snapd/snapd.pro index c48b8661..f579a663 100644 --- a/snapd/snapd.pro +++ b/snapd/snapd.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginsnapd) diff --git a/tcpcommander/tcpcommander.pro b/tcpcommander/tcpcommander.pro index 6fb6ac66..c72b3825 100644 --- a/tcpcommander/tcpcommander.pro +++ b/tcpcommander/tcpcommander.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_deviceplugintcpcommander) diff --git a/udpcommander/udpcommander.pro b/udpcommander/udpcommander.pro index 64e5b18b..82d2d26a 100644 --- a/udpcommander/udpcommander.pro +++ b/udpcommander/udpcommander.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginudpcommander) diff --git a/unitec/unitec.pro b/unitec/unitec.pro index 5f5365ea..94aeb35a 100644 --- a/unitec/unitec.pro +++ b/unitec/unitec.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginunitec) diff --git a/wakeonlan/wakeonlan.pro b/wakeonlan/wakeonlan.pro index 25a7d13a..9f1bedcf 100644 --- a/wakeonlan/wakeonlan.pro +++ b/wakeonlan/wakeonlan.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginwakeonlan) diff --git a/wemo/wemo.pro b/wemo/wemo.pro index c4b5e12e..eeb361ac 100644 --- a/wemo/wemo.pro +++ b/wemo/wemo.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginwemo) diff --git a/ws2812/ws2812.pro b/ws2812/ws2812.pro index 2dce29b6..4f14ed88 100644 --- a/ws2812/ws2812.pro +++ b/ws2812/ws2812.pro @@ -1,7 +1,3 @@ -TRANSLATIONS = translations/en_US.ts \ - translations/de_DE.ts - -# Note: include after the TRANSLATIONS definition include(../plugins.pri) TARGET = $$qtLibraryTarget(guh_devicepluginws2812)