don't autmatically run translations compiler
instead add a manual "translations" target
This commit is contained in:
parent
844de5d2e6
commit
1167001b0b
1
debian/guh-translations.install
vendored
1
debian/guh-translations.install
vendored
@ -1,2 +1,3 @@
|
|||||||
translations/*.qm usr/share/guh/translations
|
translations/*.qm usr/share/guh/translations
|
||||||
|
plugins/mock/translations/*.qm usr/share/guh/translations
|
||||||
|
|
||||||
|
|||||||
2
debian/rules
vendored
2
debian/rules
vendored
@ -11,7 +11,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
$(info Building with DEB_BUILD_OPTIONS: [${DEB_BUILD_OPTIONS}])
|
$(info Building with DEB_BUILD_OPTIONS: [${DEB_BUILD_OPTIONS}])
|
||||||
MAKE_TARGETS=all
|
MAKE_TARGETS=all lrelease
|
||||||
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
|
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
|
||||||
MAKE_TARGETS += doc
|
MAKE_TARGETS += doc
|
||||||
endif
|
endif
|
||||||
|
|||||||
20
guh.pro
20
guh.pro
@ -20,7 +20,25 @@ licensecheck.commands = $$top_srcdir/tests/auto/checklicenseheaders.sh $$top_src
|
|||||||
test.depends = licensecheck
|
test.depends = licensecheck
|
||||||
test.commands = LD_LIBRARY_PATH=$$top_builddir/libguh-core:$$top_builddir/libguh make check
|
test.commands = LD_LIBRARY_PATH=$$top_builddir/libguh-core:$$top_builddir/libguh make check
|
||||||
|
|
||||||
QMAKE_EXTRA_TARGETS += licensecheck doc test
|
# Translations:
|
||||||
|
# make lupdate to update .ts files
|
||||||
|
TRANSLATIONS += $$files(translations/*.ts, true)
|
||||||
|
TRANSLATIONS += $$files(plugins/mock/translations/*.ts, true)
|
||||||
|
lupdate.depends = FORCE
|
||||||
|
lupdate.commands = $$[QT_INSTALL_BINS]/lupdate -recursive -no-obsolete $$_FILE_;
|
||||||
|
|
||||||
|
# make lrelease to compile .ts to .qm
|
||||||
|
lrelease.depends = FORCE
|
||||||
|
lrelease.commands = $$[QT_INSTALL_BINS]/lrelease $$_FILE_; \
|
||||||
|
rsync -a $$top_srcdir/translations/*.qm $$top_builddir/translations/;
|
||||||
|
|
||||||
|
# Install translation files
|
||||||
|
translations.path = /usr/share/guh/translations
|
||||||
|
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
||||||
|
translations.depends = lrelease
|
||||||
|
INSTALLS += translations
|
||||||
|
|
||||||
|
QMAKE_EXTRA_TARGETS += licensecheck doc test lupdate lrelease
|
||||||
|
|
||||||
# Inform about guh build
|
# Inform about guh build
|
||||||
message(============================================)
|
message(============================================)
|
||||||
|
|||||||
@ -267,9 +267,6 @@ def addTranslationString(string, comment):
|
|||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------
|
||||||
def writeTranslationStrings():
|
def writeTranslationStrings():
|
||||||
if len(args.translations) is 0:
|
|
||||||
return
|
|
||||||
|
|
||||||
if len(translationStrings) is not 0:
|
if len(translationStrings) is not 0:
|
||||||
writeToFile('// Translation strings')
|
writeToFile('// Translation strings')
|
||||||
writeToFile('const QString translations[] {')
|
writeToFile('const QString translations[] {')
|
||||||
@ -337,10 +334,6 @@ def writePluginInfoFile():
|
|||||||
outputFile.close()
|
outputFile.close()
|
||||||
print(' --> Generated successfully \"%s\"' % (args.output))
|
print(' --> Generated successfully \"%s\"' % (args.output))
|
||||||
|
|
||||||
# Translate
|
|
||||||
if len(translationStrings) is not 0:
|
|
||||||
createTranslationFiles()
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------
|
||||||
def writeExternPluginInfoFile():
|
def writeExternPluginInfoFile():
|
||||||
|
|||||||
@ -1,7 +1,3 @@
|
|||||||
TRANSLATIONS = translations/en_US.ts \
|
|
||||||
translations/de_DE.ts
|
|
||||||
|
|
||||||
# Note: include after the TRANSLATIONS definition
|
|
||||||
include(../plugins.pri)
|
include(../plugins.pri)
|
||||||
|
|
||||||
QT+= network
|
QT+= network
|
||||||
|
|||||||
@ -7,6 +7,7 @@ QT += network bluetooth
|
|||||||
|
|
||||||
INCLUDEPATH += $$top_srcdir/libguh
|
INCLUDEPATH += $$top_srcdir/libguh
|
||||||
LIBS += -L../../libguh -lguh
|
LIBS += -L../../libguh -lguh
|
||||||
|
HEADERS += plugininfo.h
|
||||||
|
|
||||||
# Create plugininfo file
|
# Create plugininfo file
|
||||||
JSONFILES = deviceplugin"$$TARGET".json
|
JSONFILES = deviceplugin"$$TARGET".json
|
||||||
@ -18,11 +19,7 @@ plugininfo.commands = touch ${QMAKE_FILE_OUT}; $$top_srcdir/plugins/guh-generate
|
|||||||
--filetype i \
|
--filetype i \
|
||||||
--jsonfile ${QMAKE_FILE_NAME} \
|
--jsonfile ${QMAKE_FILE_NAME} \
|
||||||
--output ${QMAKE_FILE_OUT} \
|
--output ${QMAKE_FILE_OUT} \
|
||||||
--builddir $$OUT_PWD \
|
--builddir $$OUT_PWD;
|
||||||
--translations $$TRANSLATIONS; \
|
|
||||||
rsync -a "$$OUT_PWD"/translations/*.qm $$top_builddir/translations/;
|
|
||||||
PRE_TARGETDEPS +=
|
|
||||||
QMAKE_EXTRA_COMPILERS +=
|
|
||||||
|
|
||||||
externplugininfo.target = extern-plugininfo.h
|
externplugininfo.target = extern-plugininfo.h
|
||||||
externplugininfo.output = extern-plugininfo.h
|
externplugininfo.output = extern-plugininfo.h
|
||||||
@ -32,17 +29,10 @@ externplugininfo.commands = touch ${QMAKE_FILE_OUT}; $$top_srcdir/plugins/guh-ge
|
|||||||
--filetype e \
|
--filetype e \
|
||||||
--jsonfile ${QMAKE_FILE_NAME} \
|
--jsonfile ${QMAKE_FILE_NAME} \
|
||||||
--output ${QMAKE_FILE_OUT} \
|
--output ${QMAKE_FILE_OUT} \
|
||||||
--builddir $$OUT_PWD \
|
--builddir $$OUT_PWD;
|
||||||
--translations $$TRANSLATIONS;
|
|
||||||
PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_all
|
PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_all
|
||||||
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
|
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
|
||||||
|
|
||||||
|
|
||||||
# Install translation files
|
|
||||||
translations.path = /usr/share/guh/translations
|
|
||||||
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
|
||||||
|
|
||||||
# Install plugin
|
# Install plugin
|
||||||
target.path = $$GUH_PLUGINS_PATH
|
target.path = $$GUH_PLUGINS_PATH
|
||||||
INSTALLS += target translations
|
INSTALLS += target
|
||||||
|
|
||||||
|
|||||||
@ -12,26 +12,6 @@ QT *= sql xml websockets bluetooth dbus network
|
|||||||
|
|
||||||
LIBS += -L$$top_builddir/libguh/ -lguh -L$$top_builddir/libguh-core -lguh-core -lssl -lcrypto -laws-iot-sdk-cpp -lmbedtls -lmbedx509 -lmbedcrypto
|
LIBS += -L$$top_builddir/libguh/ -lguh -L$$top_builddir/libguh-core -lguh-core -lssl -lcrypto -laws-iot-sdk-cpp -lmbedtls -lmbedx509 -lmbedcrypto
|
||||||
|
|
||||||
# Translations
|
|
||||||
TRANSLATIONS *= $$top_srcdir/translations/guhd-en_US.ts \
|
|
||||||
$$top_srcdir/translations/guhd-de_DE.ts
|
|
||||||
|
|
||||||
# Update ts files and create translation qm files
|
|
||||||
lrelease.input = TRANSLATIONS
|
|
||||||
lrelease.CONFIG += no_link
|
|
||||||
lrelease.output = $$top_srcdir/${QMAKE_FILE_BASE}.qm
|
|
||||||
lrelease.commands = $$[QT_INSTALL_BINS]/lupdate -recursive -no-obsolete $$_FILE_; \
|
|
||||||
$$[QT_INSTALL_BINS]/lrelease ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm; \
|
|
||||||
rsync -a $$top_srcdir/translations/*.qm $$top_builddir/translations/;
|
|
||||||
|
|
||||||
QMAKE_EXTRA_COMPILERS += lrelease
|
|
||||||
PRE_TARGETDEPS += compiler_lrelease_make_all
|
|
||||||
|
|
||||||
# Install translation files
|
|
||||||
translations.path = /usr/share/guh/translations
|
|
||||||
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
|
||||||
INSTALLS += translations
|
|
||||||
|
|
||||||
# Server files
|
# Server files
|
||||||
include(qtservice/qtservice.pri)
|
include(qtservice/qtservice.pri)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user