Automatically build translations

This runs lrelease against the .ts files and automatically recreates the .qm
files if any of the .ts files changes.

This also moves the .ts files into the translations directory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-10 12:39:01 -07:00
parent f5423c48b8
commit e3e47b34a1
21 changed files with 33 additions and 19 deletions

View file

@ -113,4 +113,18 @@ XSLTDIR = $(DATADIR)/subsurface
INSTALLS += target desktop icon manpage xslt doc marbledir
install.target = install
}
!isEmpty(TRANSLATIONS) {
isEmpty(QMAKE_LRELEASE) {
win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
isEmpty(TS_DIR):TS_DIR = translations
TSQM.target = .translations
TSQM.name = lrelease subsurface.pro
TSQM.depends = $$TRANSLATIONS
TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE subsurface.pro && echo "OK" > .translations
QMAKE_EXTRA_TARGETS += TSQM
PRE_TARGETDEPS += .translations
}
QMAKE_EXTRA_TARGETS += install $$install.depends

View file

@ -123,25 +123,25 @@ FORMS = \
RESOURCES = subsurface.qrc
TRANSLATIONS = \
subsurface_bg_BG.ts \
subsurface_ca_ES.ts \
subsurface_da_DK.ts \
subsurface_de_CH.ts \
subsurface_de_DE.ts \
subsurface_es_ES.ts \
subsurface_et_EE.ts \
subsurface_fi_FI.ts \
subsurface_fr_FR.ts \
subsurface_hr_HR.ts \
subsurface_it_IT.ts \
subsurface_nb_NO.ts \
subsurface_nl_NL.ts \
subsurface_pl_PL.ts \
subsurface_pt_BR.ts \
subsurface_pt_PT.ts \
subsurface_ru_RU.ts \
subsurface_sk_SK.ts \
subsurface_sv_SE.ts
translations/subsurface_bg_BG.ts \
translations/subsurface_ca_ES.ts \
translations/subsurface_da_DK.ts \
translations/subsurface_de_CH.ts \
translations/subsurface_de_DE.ts \
translations/subsurface_es_ES.ts \
translations/subsurface_et_EE.ts \
translations/subsurface_fi_FI.ts \
translations/subsurface_fr_FR.ts \
translations/subsurface_hr_HR.ts \
translations/subsurface_it_IT.ts \
translations/subsurface_nb_NO.ts \
translations/subsurface_nl_NL.ts \
translations/subsurface_pl_PL.ts \
translations/subsurface_pt_BR.ts \
translations/subsurface_pt_PT.ts \
translations/subsurface_ru_RU.ts \
translations/subsurface_sk_SK.ts \
translations/subsurface_sv_SE.ts
doc.commands = $(CHK_DIR_EXISTS) Documentation || $(MKDIR) Documentation
doc.commands += $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_PWD/Documentation doc