Blob Blame History Raw
From 25c8e71e0acea773b62f4772069b1c8b63257c3e Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Fri, 31 Jan 2020 12:24:54 -0500
Subject: [PATCH 35/37] improvement: translations: build target to merge from
 master

This new target, merge-po, will automatically merge new translations
from the master branch. It's meant to be run only from the stable
branches.

(cherry picked from commit 8f5998c84dbb35edb477e1a98e274fd43b29bdcd)
(cherry picked from commit 3714754699df142c7ec88182603079286a41ef86)
---
 Makefile.am | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 85da0b5857d2..72dc039b5591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -118,6 +118,19 @@ update-po:
 	ls $(top_srcdir)/po/*.po | sed 's/.*\/po\///;s/.po//' > $(top_srcdir)/po/LINGUAS
 	$(MAKE) -C po update-po ${PACKAGE_NAME}.pot
 
+# This merges translations from the upstream master branch.
+# It's only meant to be used from the stable branches. Translations
+# contributions are only done against master.
+merge-po: update-po
+	git fetch -q https://github.com/firewalld/firewalld master; \
+	for po in $(top_srcdir)/po/*.po; do \
+		mv $${po} $${po}.old; \
+		git checkout -q FETCH_HEAD $${po}; \
+		msgcat --use-first -o $${po}.merged $${po} $${po}.old; \
+		mv $${po}.merged $${po}; \
+		git add $${po}; \
+	done
+
 clean-po:
 	@for cat in `cat ${top_srcdir}/po/LINGUAS`; do \
 		msgattrib --translated --no-fuzzy --no-obsolete --force-po --no-location --clear-previous --strict $(top_srcdir)/po/$$cat.po -o $(top_srcdir)/po/$$cat.out; \
-- 
2.23.0