From 89a67e523e744eb168b41d192b83d17a395b4137 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 5 Apr 2006 13:40:15 +0000 Subject: [PATCH] When merging PO files, take into consideration translations in other PO files of the same languages. That way, similar or equal translations in different programs are automatically propagated and the life of translators becomes a little bit easier. --- src/nls-global.mk | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/nls-global.mk b/src/nls-global.mk index 99f280dac6..e2d44f3e41 100644 --- a/src/nls-global.mk +++ b/src/nls-global.mk @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/src/nls-global.mk,v 1.11 2005/12/09 21:19:34 petere Exp $ +# $PostgreSQL: pgsql/src/nls-global.mk,v 1.12 2006/04/05 13:40:15 petere Exp $ # Common rules for Native Language Support (NLS) # @@ -91,19 +91,22 @@ maintainer-check-po: $(PO_FILES) init-po: po/$(CATALOG_NAME).pot +define merge-lang +@printf 'merging $(1) ' +@if $(MSGMERGE) $(srcdir)/po/$(1).po $< -o po/$(1).po.new $(addprefix --compendium=,$(shell find $(top_srcdir) -name $(1).po -printf '%p ')); \ +then \ + mv $(srcdir)/po/$(1).po po/$(1).po.old; \ + mv po/$(1).po.new $(srcdir)/po/$(1).po; \ +else \ + echo "msgmerge for $(1) failed"; \ + rm -f po/$(1).po.new; \ +fi + +endef + update-po: po/$(CATALOG_NAME).pot ifdef MSGMERGE - @for lang in $(LANGUAGES); do \ - echo "merging $$lang:"; \ - if $(MSGMERGE) $(srcdir)/po/$$lang.po $< -o po/$$lang.po.new; \ - then \ - mv $(srcdir)/po/$$lang.po po/$$lang.po.old; \ - mv po/$$lang.po.new $(srcdir)/po/$$lang.po; \ - else \ - echo "msgmerge for $$lang failed"; \ - rm -f po/$$lang.po.new; \ - fi; \ - done + $(foreach lang,$(LANGUAGES),$(call merge-lang,$(lang))) else @echo "You don't have 'msgmerge'." ; exit 1 endif