]> xenbits.xensource.com Git - libvirt.git/commitdiff
po: fix update-po target to take account of libvirt.pot in srcdir
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 5 Jun 2020 12:32:09 +0000 (13:32 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 8 Jun 2020 15:39:09 +0000 (16:39 +0100)
Now that we're storing libvirt.pot in git, it will be in srcdir instead
of builddir. Weblate is responsible for running msgmerge when the .pot
file changes, so add a warning that this target is not for general usage.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
po/Makefile.am

index 97e05a32f6572599d802a6280057b0440412e6f1..95294aa12ed45fcb43bdebe486f8529cd56ca185 100644 (file)
@@ -43,13 +43,16 @@ SED_PO_FIXUP_ARGS = \
 
 update-gmo: $(GMOFILES)
 
+# The results of this target should not be committed to Git. The Weblate
+# service is responsible for updating .po files when the .pot is changed.
 update-po: $(POTFILE)
+       cd $(srcdir) && \
        for lang in $(LANGS); do \
          echo "Minimizing $$lang content" && \
          $(MSGMERGE) --no-location --no-fuzzy-matching --sort-output \
            $$lang.po $(POTFILE) | \
-         $(SED) $(SED_PO_FIXUP_ARGS) > $(srcdir)/$$lang.po-t && \
-         mv $$lang.po-t $$lang.po
+         $(SED) $(SED_PO_FIXUP_ARGS) > $$lang.po-t && \
+         mv $$lang.po-t $$lang.po ; \
        done
 
 $(POTFILE): POTFILES