Skip to content

Commit acefe2b

Browse files
committed
i18n: fix misconversion in shell scripts
An earlier series that was merged at 2703572 ("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>
1 parent 415c7dd commit acefe2b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ update_squash_messages () {
467467
}' <"$squash_msg".bak
468468
} >"$squash_msg"
469469
else
470-
commit_message HEAD > "$fixup_msg" || die "$(gettext "Cannot write \$fixup_msg")"
470+
commit_message HEAD >"$fixup_msg" ||
471+
die "$(eval_gettext "Cannot write \$fixup_msg")"
471472
count=2
472473
{
473474
printf '%s\n' "$comment_char $(gettext "This is a combination of 2 commits.")"

git-sh-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ require_work_tree_exists () {
194194
if test "z$(git rev-parse --is-bare-repository)" != zfalse
195195
then
196196
program_name=$0
197-
die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
197+
die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
198198
fi
199199
}
200200
201201
require_work_tree () {
202202
test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || {
203203
program_name=$0
204-
die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
204+
die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
205205
}
206206
}
207207

0 commit comments

Comments
 (0)