From f2828681881061ed4e2688b3d08f4d9bdf7bc58e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 10 Oct 2009 15:22:27 +0200 Subject: [PATCH] Allow xgettext to extract strings from .ui files --- po/Makevars | 3 --- po/automake.mk | 14 +++++++------- src/ui/gui/automake.mk | 19 +++++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/po/Makevars b/po/Makevars index fdb45c8e..4952d35d 100644 --- a/po/Makevars +++ b/po/Makevars @@ -3,9 +3,6 @@ # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's diff --git a/po/automake.mk b/po/automake.mk index dbe86dc8..67d68d74 100644 --- a/po/automake.mk +++ b/po/automake.mk @@ -10,16 +10,17 @@ POTFILE=po/$(DOMAIN).pot TRANSLATABLE_FILES = $(DIST_SOURCES) $(all_q_sources) -$(POTFILE): $(TRANSLATABLE_FILES) - @$(MKDIR_P) po - $(XGETTEXT) --directory=$(top_srcdir) $(TRANSLATABLE_FILES) \ - $(XGETTEXT_OPTIONS) \ +XGETTEXT_OPTIONS = \ --copyright-holder="$(COPYRIGHT_HOLDER)" \ --package-name=$(PACKAGE) \ --package-version=$(VERSION) \ --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) \ - --add-comments='TRANSLATORS:' \ - -o $(POTFILE) + --add-comments='TRANSLATORS:' + +$(POTFILE): $(TRANSLATABLE_FILES) $(UI_FILES) + @$(MKDIR_P) po + $(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@ + $(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=glade -o $@ $(POFILES): $(POTFILE) @@ -40,7 +41,6 @@ install-data-hook: $(GMOFILES) lang=`echo $$f | sed -e 's%po/\(.*\)\.gmo%\1%' ` ; \ $(INSTALL) -D $$f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \ done - uninstall-hook: for f in $(GMOFILES); do \ diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 77ad7f5a..1383e160 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -53,6 +53,16 @@ uninstall-icons: UNINSTALL_DATA_HOOKS += uninstall-icons +UI_FILES = \ + src/ui/gui/crosstabs.ui \ + src/ui/gui/descriptives.ui \ + src/ui/gui/examine.ui \ + src/ui/gui/find.ui \ + src/ui/gui/frequencies.ui \ + src/ui/gui/rank.ui \ + src/ui/gui/recode.ui \ + src/ui/gui/variable-info.ui + nodist_src_ui_gui_psppire_DATA = \ $(top_builddir)/src/ui/gui/data-editor.ui \ $(top_builddir)/src/ui/gui/message-dialog.ui \ @@ -68,14 +78,7 @@ nodist_src_ui_gui_psppire_DATA = \ dist_src_ui_gui_psppire_DATA = \ - $(top_srcdir)/src/ui/gui/crosstabs.ui \ - $(top_srcdir)/src/ui/gui/descriptives.ui \ - $(top_srcdir)/src/ui/gui/examine.ui \ - $(top_srcdir)/src/ui/gui/find.ui \ - $(top_srcdir)/src/ui/gui/frequencies.ui \ - $(top_srcdir)/src/ui/gui/rank.ui \ - $(top_srcdir)/src/ui/gui/recode.ui \ - $(top_srcdir)/src/ui/gui/variable-info.ui \ + $(UI_FILES) \ $(top_srcdir)/src/ui/gui/pspplogo.png \ $(top_srcdir)/src/ui/gui/icons/value-labels.png \ $(top_srcdir)/src/ui/gui/icons/goto-variable.png\ -- 2.30.2