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

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