[libvirt] [glib PATCH 2/2] po: change update rules to use weblate instead of zanata

Daniel P. Berrangé berrange at redhat.com
Mon Dec 16 12:40:32 UTC 2019


The Zanata project is dead and so Fedora is transitioning over to using
Weblate for managing translations. With Weblate, languages are only
created on the server when the first translation is started, so we must
check to see if any new languages exist during download, so that they
can be added to the local languages list.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 po/Makefile.am | 20 +++++++++++++++++---
 po/zanata.xml  |  7 -------
 2 files changed, 17 insertions(+), 10 deletions(-)
 delete mode 100644 po/zanata.xml

diff --git a/po/Makefile.am b/po/Makefile.am
index 65827ac..cb72e0c 100644
--- a/po/Makefile.am
+++ b/po/Makefile.am
@@ -55,13 +55,27 @@ update-mini-po: $(POTFILE)
 	done
 
 push-pot: $(POTFILE)
-	zanata push --push-type=source
+	wlc upload --method replace -i libvirt-glib.pot libvirt-glib/application/en
 
-pull-po: $(POTFILE)
-	zanata pull --create-skeletons
+pull-po: $(POTFILE) check-new-langs
+	@for lang in $(LANGS); do \
+	  echo "Downloading $$lang" && \
+	  wlc download -o  $$lang.po libvirt-glib/application/$$lang ; \
+	done
 	$(MAKE) update-mini-po
 	$(MAKE) update-gmo
 
+check-new-langs:
+	@for po in `wlc ls libvirt-glib/application | \
+	    grep filename | grep -v 'en.po' | \
+	    sed -e 's/filename: //' -e 's/.po/.mini.po/'` ; \
+	do \
+	  if ! test -f "$$po" ; \
+	  then \
+	    echo "New language $$po in weblate" && exit 1; \
+	  fi ; \
+	done
+
 $(POTFILE): POTFILES $(POTFILE_DEPS)
 	$(XGETTEXT) -o $@-t $(XGETTEXT_ARGS) \
 	  --files-from=$(abs_srcdir)/POTFILES
diff --git a/po/zanata.xml b/po/zanata.xml
deleted file mode 100644
index 042c695..0000000
--- a/po/zanata.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<config xmlns="http://zanata.org/namespace/config/">
-  <url>https://fedora.zanata.org/</url>
-  <project>libvirt-glib</project>
-  <project-version>master</project-version>
-  <project-type>gettext</project-type>
-</config>
-- 
2.23.0




More information about the libvir-list mailing list