grub/po/gettext-patches/0002-Handle-gettext_printf-shell-function.patch
Colin Watson ac116bd659 gettext: Restore patches to po/Makefile.in.in
These were inadvertently lost during the conversion to Gnulib (gnulib:
Upgrade Gnulib and switch to bootstrap tool; commit 35b909062). The
files in po/gettext-patches/ can be imported using "git am" on top of
the gettext tag corresponding to AM_GNU_GETTEXT_VERSION in configure.ac
(currently 0.18.3). They handle translation of messages in shell files,
make msgfmt output in little-endian format, and arrange to use @SHELL@
rather than /bin/sh.

There were some changes solely for the purpose of distributing extra
files; for ease of maintenance, I've added these to
conf/Makefile.extra-dist instead.

Fixes: https://savannah.gnu.org/bugs/?57298

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-03-10 21:17:54 +01:00

46 lines
2 KiB
Diff

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