[PATCH v2a,v2b 0/2][BZ #13853] Don't use Bash-only $"msgid" quoting
P. J. McDermott
pjm@nac.net
Mon Nov 26 05:47:00 GMT 2012
Hi,
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
comments.)
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"
instead of
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. :)
Thanks,
--
P. J. McDermott
http://www.pehjota.net/
http://www.pehjota.net/contact.html
More information about the Libc-alpha
mailing list