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

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