summaryrefslogtreecommitdiffstats
path: root/po/gettext-patches/0002-Handle-gettext_printf-shell-function.patch
blob: 2767ed65e57a569450bd9da5bd0e7ed2bc5a5fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From fd17c51f2e6c87427679fbdfb5f6224ff48795db Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 1 Mar 2020 12:00:41 +0000
Subject: [PATCH 2/4] Handle gettext_printf shell function

Extract gettext_printf arguments.

Run grub.d.sed over strings extracted from util/grub.d/, in order to set
c-format flags (xgettext refuses to include these itself for strings it
extracted from a shell file, but these really are c-format).
---
 gettext-runtime/po/Makefile.in.in | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
index 32e9323d3..32e0c99a2 100644
--- a/gettext-runtime/po/Makefile.in.in
+++ b/gettext-runtime/po/Makefile.in.in
@@ -183,7 +183,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
 	      --files-from=$(srcdir)/POTFILES-shell.in \
 	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
 	      --msgid-bugs-address="$$msgid_bugs_address" \
-	      --join-existing --language=Shell --keyword=gettext_quoted \
+	      --join-existing --language=Shell \
+	      --keyword=gettext_quoted --keyword=gettext_printf \
 	    ;; \
 	  *) \
 	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
@@ -193,10 +194,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
 	      --package-name="$${package_gnu}@PACKAGE@" \
 	      --package-version='@VERSION@' \
 	      --msgid-bugs-address="$$msgid_bugs_address" \
-	      --join-existing --language=Shell --keyword=gettext_quoted \
+	      --join-existing --language=Shell \
+	      --keyword=gettext_quoted --keyword=gettext_printf \
 	    ;; \
 	esac; \
 	test ! -f $(DOMAIN).po || { \
+	  sed -f grub.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \
+	  mv $(DOMAIN).1po $(DOMAIN).po; \
 	  if test -f $(srcdir)/$(DOMAIN).pot; then \
 	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
 	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
-- 
2.17.1