* util/grub-mkconfig_lib.in (gettext_quoted): Add clarifying

comment.  Add an extra layer of quotation, requiring the output of
this function to be used in a printf format string.
(gettext_printf): New function.
* util/grub.d/10_hurd.in: Use gettext_printf where appropriate.
Extract translatable strings from here-documents and use a temporary
variable instead, so that xgettext can find them.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.

* po/grub.d.sed: New file.
* po/Makefile.in.in ($(DOMAIN).pot-update): Extract gettext_printf
arguments.  Set c-format flags on all strings extracted from
util/grub.d/ (xgettext refuses to include these itself for strings
it extracted from a shell file, but these really are c-format).
This commit is contained in:
Colin Watson 2010-12-21 12:49:29 +00:00
parent 5318fe9804
commit 4e01b6c821
8 changed files with 58 additions and 12 deletions

View file

@ -173,7 +173,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) \
@ -183,10 +184,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
po/grub.d.sed Normal file
View file

@ -0,0 +1,2 @@
/^#: util\/grub\.d\//a\
#, c-format