view po/Makefile.in.in.patch @ 1577:240cf36c9a44

Fix up po/Makefile to rebuild geeqie.pot when POTFILES.in was modified. Without this change, new translatable strings in recently added files were not available for translation in various .po files after a make update-po. Makefile.in.in.patch was modified to include this fix plus some minor cleanups.
author zas_
date Tue, 28 Apr 2009 21:37:27 +0000
parents 53cfc5af7fd7
children
line wrap: on
line source

--- Makefile.in.in	2009-04-28 23:27:08.000000000 +0200
+++ Makefile.in.in.new	2009-04-28 23:25:22.000000000 +0200
@@ -92,7 +92,7 @@
 all-yes: $(CATALOGS)
 all-no:
 
-$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
+$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
 	$(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
 	  --add-comments --keyword=_ --keyword=N_ \
           --flag=g_strdup_printf:1:c-format \
@@ -216,8 +216,31 @@
 	    || cp -p $(srcdir)/$$file $(distdir); \
 	done
 
-update-po: Makefile
-	$(MAKE) $(GETTEXT_PACKAGE).pot
+### Updating po and gmo files
+#
+# Update by merging all .po files with the .po template master file.
+#
+# It is possible to update only a single .po file by setting the PO variable to
+# either <lang> or <lang>.po when calling make. Example: make update-po PO=is
+
+update-po: Makefile $(srcdir)/$(GETTEXT_PACKAGE).pot
+	@cd $(srcdir); \
+	$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(CATALOGS))), \
+	  echo -n "$(lang): "; \
+	  if $(MSGMERGE) $(lang).po $(srcdir)/$(GETTEXT_PACKAGE).pot -o $(lang).new.po; then \
+	    mv -f $(lang).new.po $(lang).po; \
+	  else \
+	    echo "msgmerge failed!"; \
+	    rm -f $(lang).new.po; \
+	  fi; \
+	)
+	$(MAKE) update-gmo
+
+update-gmo: Makefile $(CATALOGS)
+	@:
+
+update-po-orig: Makefile
+	$(MAKE) $(srcdir)/$(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
 	cd $(srcdir); \
 	catalogs='$(CATALOGS)'; \
@@ -225,7 +248,7 @@
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
 	  echo "$$lang:"; \
-	  if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
+	  if $(MSGMERGE) $$lang.po $(srcdir)/$(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
 	    if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
 	      rm -f $$tmpdir/$$lang.new.po; \
             else \