gettextize: git-stash & git-bisect
cover gettextize: git-stash & git-bisect
This is an RFC on a series that makes git-stash.sh and git-bisect.sh translatable. With this git-rebase is the only mainporcelain command that isn't translatable (soon to be fixed).
I'll be folding this into the next version of the ab/i18n series I'll be sending to Junio. No need to apply it to the current one.
Note that this isn't diff --check clean, because the code I'm altering wasn't:
git-bisect.sh:117: indent with spaces.
+ die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
git-bisect.sh:190: indent with spaces.
+ revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;;
Patches to fix these whitespace issues can come later after the i18n series is applied.
Ævar Arnfjörð Bjarmason (20):
gettextize: git-stash add git-sh-i18n
gettextize: git-stash echo + gettext message
gettextize: git-stash say + gettext messages
gettextize: git-stash die + gettext messages
gettextize: git-stash die + eval_gettext messages
gettextize: git-stash die + eval_gettext $* messages
gettextize: git-stash die + eval_gettext $1 messages
gettextize: git-stash "unknown option" message
gettextize: git-stash drop_stash say/die messages
gettextize: git-bisect add git-sh-i18n
gettextize: git-bisect gettext + echo message
gettextize: git-bisect echo + gettext messages
gettextize: git-bisect echo + eval_gettext message
gettextize: git-bisect die + gettext messages
gettextize: git-bisect die + eval_gettext messages
gettextize: git-bisect bisect_run + $@ messages
gettextize: git-bisect bisect_reset + $1 messages
gettextize: git-bisect bisect_replay + $1 messages
gettextize: git-bisect [Y/n] messages
gettextize: git-bisect bisect_next_check "You need to" message
git-bisect.sh | 84 ++++++++++++++++++++++++++++++++------------------------ git-stash.sh | 75 +++++++++++++++++++++++++++++++------------------- 2 files changed, 94 insertions(+), 65 deletions(-)
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 1/20 gettextize: git-stash add git-sh-i18n
--- git-stash.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
git-stash.sh +1 -0
@@ -13,6 +13,7 @@ USAGE="list [<options>] SUBDIRECTORY_OK=Yes OPTIONS_SPEC= . git-sh-setup +. git-sh-i18n require_work_tree cd_to_toplevel
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 2/20 gettextize: git-stash echo + gettext message
In reply to Ævar Arnfjörð Bjarmason--- git-stash.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
git-stash.sh +1 -1
@@ -408,7 +408,7 @@ apply_stash () { status=$? if test -n "$INDEX_OPTION" then - echo >&2 'Index was not unstashed.' + echo >&2 "$(gettext "Index was not unstashed.")" fi exit $status fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 3/20 gettextize: git-stash say + gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-stash.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
git-stash.sh +2 -2
@@ -167,7 +167,7 @@ save_stash () { git update-index -q --refresh if no_changes then - say 'No local changes to save' + say "$(gettext "No local changes to save")" exit 0 fi test -f "$GIT_DIR/logs/$ref_stash" ||
@@ -503,7 +503,7 @@ branch) case $# in 0) save_stash && - say '(To restore them type "git stash apply")' + say "$(gettext "(To restore them type \"git stash apply\")")" ;; *) usage
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 4/20 gettextize: git-stash die + gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-stash.sh | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-)
git-stash.sh +18 -18
@@ -38,7 +38,7 @@ no_changes () { clear_stash () { if test $# != 0 then - die "git stash clear with parameters is unimplemented" + die "$(gettext "git stash clear with parameters is unimplemented")" fi if current=$(git rev-parse --verify $ref_stash 2>/dev/null) then
@@ -60,7 +60,7 @@ create_stash () { then head=$(git rev-list --oneline -n 1 HEAD --) else - die "You do not have the initial commit yet" + die "$(gettext "You do not have the initial commit yet")" fi if branch=$(git symbolic-ref -q HEAD)
@@ -75,7 +75,7 @@ create_stash () { i_tree=$(git write-tree) && i_commit=$(printf 'index on %s\n' "$msg" | git commit-tree $i_tree -p $b_commit) || - die "Cannot save the current index state" + die "$(gettext "Cannot save the current index state")" if test -z "$patch_mode" then
@@ -91,7 +91,7 @@ create_stash () { git write-tree && rm -f "$TMP-index" ) ) || - die "Cannot save the current worktree state" + die "$(gettext "Cannot save the current worktree state")" else
@@ -104,14 +104,14 @@ create_stash () { # state of the working tree w_tree=$(GIT_INDEX_FILE="$TMP-index" git write-tree) || - die "Cannot save the current worktree state" + die "$(gettext "Cannot save the current worktree state")" git diff-tree -p HEAD $w_tree > "$TMP-patch" && test -s "$TMP-patch" || - die "No changes selected" + die "$(gettext "No changes selected")" rm -f "$TMP-index" || - die "Cannot remove temporary index (can't happen)" + die "$(gettext "Cannot remove temporary index (can't happen)")" fi
@@ -124,7 +124,7 @@ create_stash () { fi w_commit=$(printf '%s\n' "$stash_msg" | git commit-tree $w_tree -p $b_commit -p $i_commit) || - die "Cannot record working tree state" + die "$(gettext "Cannot record working tree state")" } save_stash () {
@@ -171,7 +171,7 @@ save_stash () { exit 0 fi test -f "$GIT_DIR/logs/$ref_stash" || - clear_stash || die "Cannot initialize stash" + clear_stash || die "$(gettext "Cannot initialize stash")" create_stash "$stash_msg"
@@ -179,7 +179,7 @@ save_stash () { : >>"$GIT_DIR/logs/$ref_stash" git update-ref -m "$stash_msg" $ref_stash $w_commit || - die "Cannot save the current status" + die "$(gettext "Cannot save the current status")" say Saved working directory and index state "$stash_msg" if test -z "$patch_mode"
@@ -192,7 +192,7 @@ save_stash () { fi else git apply -R < "$TMP-patch" || - die "Cannot remove worktree changes" + die "$(gettext "Cannot remove worktree changes")" if test -z "$keep_index" then
@@ -294,7 +294,7 @@ parse_flags_and_rev() case $# in 0) - have_stash || die "No stash found." + have_stash || die "$(gettext "No stash found.")" set -- ${ref_stash}@{0} ;; 1)
@@ -354,11 +354,11 @@ apply_stash () { git update-index -q --refresh && git diff-files --quiet --ignore-submodules || - die 'Cannot apply to a dirty working tree, please stage your changes' + die "$(gettext "Cannot apply to a dirty working tree, please stage your changes")" # current index state c_tree=$(git write-tree) || - die 'Cannot apply a stash in the middle of a merge' + die "$(gettext "Cannot apply a stash in the middle of a merge")" unstashed_index_tree= if test -n "$INDEX_OPTION" && test "$b_tree" != "$i_tree" &&
@@ -366,9 +366,9 @@ apply_stash () { then git diff-tree --binary $s^2^..$s^2 | git apply --cached test $? -ne 0 && - die 'Conflicts in index. Try without --index.' + die "$(gettext "Conflicts in index. Try without --index.")" unstashed_index_tree=$(git write-tree) || - die 'Could not save index tree' + die "$(gettext "Could not save index tree")" git reset fi
@@ -394,7 +394,7 @@ apply_stash () { git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" && git read-tree --reset $c_tree && git update-index --add --stdin <"$a" || - die "Cannot unstage modified files" + die "$(gettext "Cannot unstage modified files")" rm -f "$a" fi squelch=
@@ -432,7 +432,7 @@ drop_stash () { } apply_to_branch () { - test -n "$1" || die 'No branch name specified' + test -n "$1" || die "$(gettext "No branch name specified")" branch=$1 shift 1
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 5/20 gettextize: git-stash die + eval_gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-stash.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
git-stash.sh +2 -2
@@ -301,7 +301,7 @@ parse_flags_and_rev() : ;; *) - die "Too many revisions specified: $REV" + die "$(eval_gettext "Too many revisions specified: \$REV")" ;; esac
@@ -325,7 +325,7 @@ parse_flags_and_rev() # this condition with a non-zero status code but as of 1.7.2.1 it # it did not. So, we use non-empty stderr output as a proxy for the # condition of interest. - test -z "$(git rev-parse "$REV" 2>&1 >/dev/null)" || die "$REV does not exist in the stash log" + test -z "$(git rev-parse "$REV" 2>&1 >/dev/null)" || die "$(eval_gettext "\$REV does not exist in the stash log")" fi }
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 6/20 gettextize: git-stash die + eval_gettext $* messages
In reply to Ævar Arnfjörð BjarmasonGettextize messages that used the $* variable. Since it's subroutine local we have to provide an alias for it for eval_gettext.
--- git-stash.sh | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
git-stash.sh +8 -2
@@ -337,7 +337,10 @@ is_stash_like() } assert_stash_like() { - is_stash_like "$@" || die "'$*' is not a stash-like commit" + is_stash_like "$@" || { + args="$*" + die "$(eval_gettext "'\$args' is not a stash-like commit")" + } } is_stash_ref() {
@@ -345,7 +348,10 @@ is_stash_ref() { } assert_stash_ref() { - is_stash_ref "$@" || die "'$*' is not a stash reference" + is_stash_ref "$@" || { + args="$*" + die "$(eval_gettext "'\$args' is not a stash reference")" + } } apply_stash () {
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 7/20 gettextize: git-stash die + eval_gettext $1 messages
In reply to Ævar Arnfjörð BjarmasonGettextize a messages that used the $1 variable. Since it's subroutine local we have to provide an alias for it for eval_gettext.
--- git-stash.sh | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
git-stash.sh +4 -1
@@ -305,7 +305,10 @@ parse_flags_and_rev() ;; esac - REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || die "$1 is not valid reference" + REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || { + reference="$1" + die "$(eval_gettext "\$reference is not valid reference")" + } i_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) && set -- $(git rev-parse $REV $REV^1 $REV: $REV^1: $REV^2: 2>/dev/null) &&
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 8/20 gettextize: git-stash "unknown option" message
In reply to Ævar Arnfjörð BjarmasonGettextize the "unknown option for 'stash save'" message that's shown on:
$ git stash save --blah-blah
error: unknown option for 'stash save': --blah-blah
To provide a message, use git stash save -- '--blah-blah'
Usage: git stash list [<options>]In a translation the second line should be aligned with the first one. I've added a TRANSLATORS comment to indicate this.
--- git-stash.sh | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
git-stash.sh +8 -2
@@ -151,8 +151,14 @@ save_stash () { break ;; -*) - echo "error: unknown option for 'stash save': $1" - echo " To provide a message, use git stash save -- '$1'" + option="$1" + # TRANSLATORS: $option is an invalid option, like + # `--blah-blah'. The 7 spaces at the beginning of the + # second line correspond to "error: ". So you should line + # up the second line with however many characters the + # translation of "error: " takes in your language. + eval_gettext "$("error: unknown option for 'stash save': \$option + To provide a message, use git stash save -- '\$option'")"; echo usage ;; *)
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 9/20 gettextize: git-stash drop_stash say/die messages
In reply to Ævar Arnfjörð BjarmasonGettextize the say/die eval_gettext messages in the drop_stash function. Since making these translatable would result in a long line I've wrapped this into two lines.
--- git-stash.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
git-stash.sh +2 -1
@@ -440,7 +440,8 @@ drop_stash () { assert_stash_ref "$@" git reflog delete --updateref --rewrite "${REV}" && - say "Dropped ${REV} ($s)" || die "${REV}: Could not drop stash entry" + say "$(eval_gettext "Dropped \${REV} (\$s)")" || + die "$(eval_gettext "\${REV}: Could not drop stash entry")" # clear_stash if we just dropped the last stash entry git rev-parse --verify "$ref_stash@{0}" > /dev/null 2>&1 || clear_stash
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 10/20 gettextize: git-bisect add git-sh-i18n
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
git-bisect.sh +1 -0
@@ -28,6 +28,7 @@ Please use "git help bisect" to get the full man page.' OPTIONS_SPEC= . git-sh-setup +. git-sh-i18n require_work_tree _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 11/20 gettextize: git-bisect gettext + echo message
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
git-bisect.sh +2 -2
@@ -306,7 +306,7 @@ bisect_visualize() { bisect_reset() { test -s "$GIT_DIR/BISECT_START" || { - echo "We are not bisecting." + gettext "We are not bisecting."; echo return } case "$#" in
@@ -406,7 +406,7 @@ bisect_run () { fi if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null; then - echo "bisect run success" + gettext "bisect run success"; echo exit 0; fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 12/20 gettextize: git-bisect echo + gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
git-bisect.sh +3 -3
@@ -36,7 +36,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" bisect_autostart() { test -s "$GIT_DIR/BISECT_START" || { - echo >&2 'You need to start by "git bisect start"' + echo >&2 "$(gettext "You need to start by \"git bisect start\"")" if test -t 0 then echo >&2 -n 'Do you want me to do it for you [Y/n]? '
@@ -239,7 +239,7 @@ bisect_next_check() { t,,good) # have bad but not good. we could bisect although # this is less optimum. - echo >&2 'Warning: bisecting only with a bad commit.' + echo >&2 "$(gettext "Warning: bisecting only with a bad commit.")" if test -t 0 then printf >&2 'Are you sure [Y/n]? '
@@ -395,7 +395,7 @@ bisect_run () { if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \ > /dev/null; then - echo >&2 "bisect run cannot continue any more" + echo >&2 "$(gettext "bisect run cannot continue any more")" exit $res fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 13/20 gettextize: git-bisect echo + eval_gettext message
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
git-bisect.sh +2 -2
@@ -400,8 +400,8 @@ bisect_run () { fi if [ $res -ne 0 ]; then - echo >&2 "bisect run failed:" - echo >&2 "'bisect_state $state' exited with error code $res" + echo >&2 "$(eval_gettext "bisect run failed: +'bisect_state \$state' exited with error code \$res")" exit $res fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 14/20 gettextize: git-bisect die + gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
git-bisect.sh +7 -7
@@ -58,7 +58,7 @@ bisect_start() { # head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) || head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) || - die "Bad HEAD - I need a HEAD" + die "$(gettext "Bad HEAD - I need a HEAD")" # # Check if we are bisecting.
@@ -77,11 +77,11 @@ bisect_start() { # cogito usage, and cogito users should understand # it relates to cg-seek. [ -s "$GIT_DIR/head-name" ] && - die "won't bisect on seeked tree" + die "$(gettext "won't bisect on seeked tree")" start_head="${head#refs/heads/}" ;; *) - die "Bad HEAD - strange symbolic ref" + die "$(gettext "Bad HEAD - strange symbolic ref")" ;; esac fi
@@ -198,10 +198,10 @@ bisect_state() { state=$1 case "$#,$state" in 0,*) - die "Please call 'bisect_state' with at least one argument." ;; + die "$(gettext "Please call 'bisect_state' with at least one argument.")" ;; 1,bad|1,good|1,skip) rev=$(git rev-parse --verify HEAD) || - die "Bad rev input: HEAD" + die "$(gettext "Bad rev input: HEAD")" bisect_write "$state" "$rev" check_expected_revs "$rev" ;; 2,bad|*,good|*,skip)
@@ -216,7 +216,7 @@ bisect_state() { eval "$eval" check_expected_revs "$@" ;; *,bad) - die "'git bisect bad' can take only one argument." ;; + die "$(gettext "'git bisect bad' can take only one argument.")" ;; *) usage ;; esac
@@ -355,7 +355,7 @@ bisect_replay () { good|bad|skip) bisect_write "$command" "$rev" ;; *) - die "?? what are you talking about?" ;; + die "$(gettext "?? what are you talking about?")" ;; esac done <"$1" bisect_auto_next
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 15/20 gettextize: git-bisect die + eval_gettext messages
In reply to Ævar Arnfjörð Bjarmason--- git-bisect.sh | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
git-bisect.sh +4 -4
@@ -111,7 +111,7 @@ bisect_start() { *) rev=$(git rev-parse -q --verify "$arg^{commit}") || { test $has_double_dash -eq 1 && - die "'$arg' does not appear to be a valid revision" + die "$(eval_gettext "'\$arg' does not appear to be a valid revision")" break } case $bad_seen in
@@ -156,7 +156,7 @@ bisect_write() { case "$state" in bad) tag="$state" ;; good|skip) tag="$state"-"$rev" ;; - *) die "Bad bisect_write argument: $state" ;; + *) die "$(eval_gettext "Bad bisect_write argument: \$state")" ;; esac git update-ref "refs/bisect/$tag" "$rev" || exit echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
@@ -184,7 +184,7 @@ bisect_skip() { do case "$arg" in *..*) - revs=$(git rev-list "$arg") || die "Bad rev input: $arg" ;; + revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;; *) revs=$(git rev-parse --sq-quote "$arg") ;; esac
@@ -210,7 +210,7 @@ bisect_state() { for rev in "$@" do sha=$(git rev-parse --verify "$rev^{commit}") || - die "Bad rev input: $rev" + die "$(eval_gettext "Bad rev input: \$rev")" eval="$eval bisect_write '$state' '$sha'; " done eval "$eval"
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 16/20 gettextize: git-bisect bisect_run + $@ messages
In reply to Ævar Arnfjörð BjarmasonGettextize bisect_run messages that use the $@ variable. Since it's subroutine local we have to provide an alias for it for eval_gettext.
--- git-bisect.sh | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
git-bisect.sh +4 -3
@@ -366,14 +366,15 @@ bisect_run () { while true do - echo "running $@" + command="$@" + eval_gettext "running \$command"; echo "$@" res=$? # Check for really bad run error. if [ $res -lt 0 -o $res -ge 128 ]; then - echo >&2 "bisect run failed:" - echo >&2 "exit code $res from '$@' is < 0 or >= 128" + echo >&2 "$(eval_gettext "bisect run failed: +exit code \$res from '\$command' is < 0 or >= 128")" exit $res fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 17/20 gettextize: git-bisect bisect_reset + $1 messages
In reply to Ævar Arnfjörð Bjarmasonettextize bisect_reset messages that use the $1 variable. Since it's subroutine local we have to provide an alias for it for eval_gettext.
--- git-bisect.sh | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
git-bisect.sh +4 -2
@@ -311,8 +311,10 @@ bisect_reset() { } case "$#" in 0) branch=$(cat "$GIT_DIR/BISECT_START") ;; - 1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null || - die "'$1' is not a valid commit" + 1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null || { + invalid="$1" + die "$(eval_gettext "'\$invalid' is not a valid commit")" + } branch="$1" ;; *) usage ;;
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 18/20 gettextize: git-bisect bisect_replay + $1 messages
In reply to Ævar Arnfjörð BjarmasonGettextize bisect_replay messages that use the $1 variable. Since it's subroutine local we have to provide an alias for it for eval_gettext.
Since I was doing that anyway I've changed all other uses of $1 variable to use the alias variable for clarity.
--- git-bisect.sh | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
git-bisect.sh +3 -2
@@ -341,7 +341,8 @@ bisect_clean_state() { } bisect_replay () { - test -r "$1" || die "cannot read $1 for replaying" + file="$1" + test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")" bisect_reset while read git bisect command rev do
@@ -359,7 +360,7 @@ bisect_replay () { *) die "$(gettext "?? what are you talking about?")" ;; esac - done <"$1" + done <"$file" bisect_auto_next }
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 19/20 gettextize: git-bisect [Y/n] messages
In reply to Ævar Arnfjörð BjarmasonGettextize the [Y/n] questions git-bisect presents, and leave a note in a TRANSLATORS comment explaining that translators have to preserve a mention of the Y/n characters since the program will expect them, and not their localized equivalents.
--- git-bisect.sh | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
git-bisect.sh +8 -2
@@ -39,7 +39,10 @@ bisect_autostart() { echo >&2 "$(gettext "You need to start by \"git bisect start\"")" if test -t 0 then - echo >&2 -n 'Do you want me to do it for you [Y/n]? ' + # TRANSLATORS: Make sure to include [Y] and [n] in your + # translation. The program will only accept English input + # at this point. + echo >&2 -n "$(gettext "Do you want me to do it for you [Y/n]? ")" read yesno case "$yesno" in [Nn]*)
@@ -242,7 +245,10 @@ bisect_next_check() { echo >&2 "$(gettext "Warning: bisecting only with a bad commit.")" if test -t 0 then - printf >&2 'Are you sure [Y/n]? ' + # TRANSLATORS: Make sure to include [Y] and [n] in your + # translation. The program will only accept English input + # at this point. + printf >&2 "$(gettext "Are you sure [Y/n]? ")" read yesno case "$yesno" in [Nn]*) exit 1 ;; esac fi
Signature · 1 line
1.7.3.rc1.234.g8dc15
PATCH 20/20 gettextize: git-bisect bisect_next_check "You need to" message
In reply to Ævar Arnfjörð BjarmasonGettextize the "You need to start by" message in bisect_next_check. This message assembled English output by hand so it needed to be split up to make it translatable.
--- git-bisect.sh | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-)
git-bisect.sh +10 -9
@@ -255,15 +255,16 @@ bisect_next_check() { : bisect without good... ;; *) - THEN='' - test -s "$GIT_DIR/BISECT_START" || { - echo >&2 'You need to start by "git bisect start".' - THEN='then ' - } - echo >&2 'You '$THEN'need to give me at least one good' \ - 'and one bad revisions.' - echo >&2 '(You can use "git bisect bad" and' \ - '"git bisect good" for that.)' + + if test -s "$GIT_DIR/BISECT_START" + then + echo >&2 "$(gettext "You need to give me at least one good and one bad revisions. +(You can use \"git bisect bad\" and \"git bisect good\" for that.)")" + else + echo >&2 "$(gettext "You need to start by \"git bisect start\". +You then need to give me at least one good and one bad revisions. +(You can use \"git bisect bad\" and \"git bisect good\" for that.)")" + fi exit 1 ;; esac }
Signature · 1 line
1.7.3.rc1.234.g8dc15