i18n: fix misconversion in shell scripts
authorJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2016 17:36:23 +0000 (09:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2016 17:36:23 +0000 (09:36 -0800)
An earlier series that was merged at 2703572b3a ("Merge branch
'va/i18n-even-more'", 2016-07-13) failed to use $(eval_gettext
"string with \$variable interpolation") and instead used gettext in
a few places, and ended up showing the variable names in the
message, e.g.

$ git submodule
fatal: $program_name cannot be used without a working tree.

Catch these mistakes with

$ git grep -n '[^_]gettext .*\\\$'

and fix them all to use eval_gettext instead.

Reported-by: Josh Bleecher Snyder
Acked-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh
git-sh-setup.sh
index a545d92c269618f50c0d4989b3ae940c728b64a4..c5806859f0d475f2be9558fd00cd1995d03dbd4a 100644 (file)
@@ -467,7 +467,8 @@ update_squash_messages () {
                        }' <"$squash_msg".bak
                } >"$squash_msg"
        else
-               commit_message HEAD > "$fixup_msg" || die "$(gettext "Cannot write \$fixup_msg")"
+               commit_message HEAD >"$fixup_msg" ||
+               die "$(eval_gettext "Cannot write \$fixup_msg")"
                count=2
                {
                        printf '%s\n' "$comment_char $(gettext "This is a combination of 2 commits.")"
index 2eda134800b08e3dfcdc2084b221280b8d95e178..c7b2a95463fd1513b6adab64d2e9110e4298db42 100644 (file)
@@ -194,14 +194,14 @@ require_work_tree_exists () {
        if test "z$(git rev-parse --is-bare-repository)" != zfalse
        then
                program_name=$0
-               die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
+               die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
        fi
 }
 
 require_work_tree () {
        test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || {
                program_name=$0
-               die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
+               die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
        }
 }