Thread (25 messages) flat view 25 messages, 2 authors, 2016-06-15

Re: [PATCH 20/20] gettextize: git-am printf(1) message to eval_gettext

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:30

On Tue, Sep 7, 2010 at 20:10, Jonathan Nieder [off-list ref] wrote:
Hi,

Ævar Arnfjörð Bjarmason wrote:
quoted
+++ b/git-am.sh
@@ -778,7 +778,7 @@ did you forget to use 'git add'?"; echo
       fi
       if test $apply_status != 0
       then
-               printf 'Patch failed at %s %s\n' "$msgnum" "$FIRSTLINE"
+               echo "$(eval_gettext "Patch failed at \$msgnum \$FIRSTLINE")"
Probably I am missing something silly, but why not just:

       eval_gettext 'Patch failed at $msgnum $FIRSTLINE\n'
That looks better, or:

    eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo

To remove the change for translators to screw up the \n, the gettext
manual uses that style.

It also uses double quotes consistently, but '' works fine too. I
don't know if '' should be avoided for some other reason, probably
not.
? I ask because it is nice to be able to avoid "echo" with arbitrary
data: special characters (e.g. \) can make for portability hassles.
Aside from this example (which looks nicer as you suggest) we'd be in
some slight trouble if the code in the patch is unportable, since I
think I'm using equivalent constructions elsewhere to thinks that get
passed to echo, but maybe that's not a problem if there's a level of
indirection.

In any case we could solve those with printf "%s" $str.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help