Blame SOURCES/0144-improvement-translations-build-target-to-merge-from-.patch

ea8ea4
From 5d31f3a1003b87fc28675febe605d1666af9e215 Mon Sep 17 00:00:00 2001
ea8ea4
From: Eric Garver <eric@garver.life>
ea8ea4
Date: Fri, 31 Jan 2020 12:24:54 -0500
ea8ea4
Subject: [PATCH 144/146] improvement: translations: build target to merge from
ea8ea4
 master
ea8ea4
ea8ea4
This new target, merge-po, will automatically merge new translations
ea8ea4
from the master branch. It's meant to be run only from the stable
ea8ea4
branches.
ea8ea4
ea8ea4
(cherry picked from commit 8f5998c84dbb35edb477e1a98e274fd43b29bdcd)
ea8ea4
(cherry picked from commit fe686a53538ee34e1ba5ef8a178c4b3a0688ee9c)
ea8ea4
---
ea8ea4
 Makefile.am | 13 +++++++++++++
ea8ea4
 1 file changed, 13 insertions(+)
ea8ea4
ea8ea4
diff --git a/Makefile.am b/Makefile.am
ea8ea4
index 77f461c8bae5..9f3135118ed2 100644
ea8ea4
--- a/Makefile.am
ea8ea4
+++ b/Makefile.am
ea8ea4
@@ -105,6 +105,19 @@ update-po:
ea8ea4
 	ls $(top_srcdir)/po/*.po | sed 's/.*\/po\///;s/.po//' > $(top_srcdir)/po/LINGUAS
ea8ea4
 	$(MAKE) -C po update-po ${PACKAGE_NAME}.pot
ea8ea4
 
ea8ea4
+# This merges translations from the upstream master branch.
ea8ea4
+# It's only meant to be used from the stable branches. Translations
ea8ea4
+# contributions are only done against master.
ea8ea4
+merge-po: update-po
ea8ea4
+	git fetch -q https://github.com/firewalld/firewalld master; \
ea8ea4
+	for po in $(top_srcdir)/po/*.po; do \
ea8ea4
+		mv $${po} $${po}.old; \
ea8ea4
+		git checkout -q FETCH_HEAD $${po}; \
ea8ea4
+		msgcat --use-first -o $${po}.merged $${po} $${po}.old; \
ea8ea4
+		mv $${po}.merged $${po}; \
ea8ea4
+		git add $${po}; \
ea8ea4
+	done
ea8ea4
+
ea8ea4
 clean-po:
ea8ea4
 	@for cat in `cat ${top_srcdir}/po/LINGUAS`; do \
ea8ea4
 		msgattrib --translated --no-fuzzy --no-obsolete --force-po --no-location --clear-previous --strict $(top_srcdir)/po/$$cat.po -o $(top_srcdir)/po/$$cat.out; \
ea8ea4
-- 
ea8ea4
2.23.0
ea8ea4