Allow xgettext to extract strings from .ui files
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 10 Oct 2009 13:22:27 +0000 (15:22 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 10 Oct 2009 13:22:27 +0000 (15:22 +0200)
po/Makevars
po/automake.mk
src/ui/gui/automake.mk

index fdb45c8e9111c708a6c4e7acd108a8ad98cdb9d9..4952d35daffae50f21a0858fed0e5e877ae89a67 100644 (file)
@@ -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
index dbe86dc8a6efe242bbae6fb17882a8682ca8714e..67d68d741e24a6e09ef7506d4b54841db8e7e099 100644 (file)
@@ -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 \
index 77ad7f5a8f3992b71cafdf93a427f76d6e0d6846..1383e1601beb50950d618270d0255727baa48301 100644 (file)
@@ -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\