From 21ffa3ce3ad6f8909d88edca1a1208a091078bb5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sat, 14 Sep 2013 11:52:42 -0400 Subject: [PATCH] autotools: add translate target for qt translations --- src/Makefile.am | 4 ++++ src/qt/Makefile.am | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 349978423..65e675e52 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,6 +58,10 @@ leveldb/libmemenv.a: @echo "Building LevelDB ..." && cd leveldb && CXX="$(CXX)" CC="$(CC)" \ PLATFORM=$(TARGET_OS) AR="$(AR)" $(MAKE) $(LEVELDB_TARGET_FLAGS) OPT="$(CXXFLAGS) $(CPPFLAGS)" libmemenv.a +qt/bitcoinstrings.cpp: $(libbitcoin_a_SOURCES) + @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" + @cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py + CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index af8ebee6c..33c5825eb 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -153,8 +153,16 @@ QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI: #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) +.PHONY: FORCE .SECONDARY: $(QT_QM) +bitcoinstrings.cpp: FORCE + $(MAKE) -C $(top_srcdir)/src qt/bitcoinstrings.cpp + +translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) $(QR_CPP) + @test -n $(LUPDATE) || echo "lupdate is required for updating translations" + @$(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts + $(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) @cd $(abs_srcdir); test -f $(RCC) && $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ echo error: could not build $@