]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Create autogenerated PO files if they don't exist.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2009 17:37:02 +0000 (19:37 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2009 17:37:02 +0000 (19:37 +0200)
gettext-tools/examples/ChangeLog
gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile

index 121a28965834ccb2fcc106ba2420e6be9fd401fb..e6bff417d3f0fc5871f4a7548d73da32f4eeb448 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-16  Bruno Haible  <bruno@clisp.org>
+
+       * hello-objc-gnustep/po/GNUmakefile: Apply 2004-01-17 changes to
+       hello-*/po/Makefile.am.
+
 2009-07-29  Bruno Haible  <bruno@clisp.org>
 
        * po/lv.po: New file, from Rihards PriedÄ«tis <rprieditis@gmail.com>.
index d4c159bc73d59bc1d879532661663ff306ff1604..5555adc505d1f05706208da2d3528e74760d22d8 100644 (file)
@@ -68,7 +68,7 @@ STRINGSFILES = $(foreach lang, $(LINGUAS), $(top_srcdir)/$(NSLOCALE_$(lang)).lpr
 ENSTRINGSFILES = $(foreach lang, $(ENLINGUAS), $(top_srcdir)/$(NSLOCALE_$(lang)).lproj/Localizable.strings)
 CATALOGS = $(STRINGSFILES) $(ENSTRINGSFILES)
 
-.SUFFIXES: .po .mo .sed .sin .nop .po-update
+.SUFFIXES: .po .mo .sed .sin .nop .po-create .po-update
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
@@ -117,19 +117,30 @@ $(DOMAIN).pot:
 # Note that a PO file is not touched if it doesn't need to be changed.
 $(POFILES): $(DOMAIN).pot
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
-       echo "$(MSGMERGE_UPDATE) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
-       case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
-         '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
-           $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot;; \
-         *) \
-           $(MSGMERGE_UPDATE) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
-       esac
+       if test -f $${lang}.po; then \
+         echo "$(MSGMERGE_UPDATE) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+         case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+           '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+             $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot;; \
+           *) \
+             $(MSGMERGE_UPDATE) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+         esac; \
+       else \
+         $(MAKE) $${lang}.po-create; \
+       fi
 
 update-po:
        $(MAKE) $(DOMAIN).pot-update
        test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
        $(MAKE) update-strings
 
+# General rule for creating PO files.
+
+.nop.po-create:
+       @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+       echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+       exit 1
+
 # General rule for updating PO files.
 
 .nop.po-update: