This is the mail archive of the
mailing list for the glibc project.
[PATCH v2a,v2b 0/2][BZ #13853] Don't use Bash-only $"msgid" quoting
- From: "P. J. McDermott" <pjm at nac dot net>
- To: libc-alpha at sourceware dot org
- Date: Mon, 26 Nov 2012 00:47:15 -0500
- Subject: [PATCH v2a,v2b 0/2][BZ #13853] Don't use Bash-only $"msgid" quoting
- Reply-to: libc-alpha at sourceware dot org, "P. J. McDermott" <pjm at nac dot net>
This is an update of patch 2/2 from my previously proposed patchset.
(Patch 1/2 of that set can be applied at any time as-is, pending
I'm proposing two alternative solutions this time, each split into two
patches (as advised by Dmitry V. Levin):
* v2a, as discussed, simply replaces parameter expansions in
translatable strings with printf conversion specifications and
replaces $"msgid" quoting with calls to a new _gettext wrapper
function that calls gettext if installed.
* v2b goes a little further. It uses printf instead of echo for all
translatable output, adds script and year variables (as in Carlos
O'Donell's patch in BZ #13853), and replaces printf and $"msgid"
quoting with a new gettextf function.
I prefer the v2b set, as it removes almost all uses of echo and (in my
opinion) results in cleaner and more consistent code, e.g.
gettextf >&2 "executable \`%s' not found\n" "$program"
printf >&2 "$(_gettext "executable \`%s' not found\n")" "$program"
I've reviewed the changes multiple times and tested many of the strings,
but do let me know if I've made any more obvious mistakes. :)
P. J. McDermott