@@ -37,13 +37,14 @@ rerere-autoupdate update the index with reused conflict resolution if possible
3737rebasing* (internal use for git-rebase)"
3838
3939. git-sh-setup
40+ . git-sh-i18n
4041prefix=$( git rev-parse --show-prefix)
4142set_reflog_action am
4243require_work_tree
4344cd_to_toplevel
4445
4546git var GIT_COMMITTER_IDENT > /dev/null ||
46- die " You need to set your committer info first"
47+ die " $( gettext " You need to set your committer info first" ) "
4748
4849if git rev-parse --verify -q HEAD > /dev/null
4950then
@@ -88,8 +89,11 @@ safe_to_abort () {
8889 then
8990 return 0
9091 fi
91- echo >&2 " You seem to have moved HEAD since the last 'am' failure."
92- echo >&2 " Not rewinding to ORIG_HEAD"
92+ (
93+ gettext " You seem to have moved HEAD since the last 'am' failure.
94+ Not rewinding to ORIG_HEAD" &&
95+ echo
96+ ) >&2
9397 return 1
9498}
9599
@@ -98,9 +102,9 @@ stop_here_user_resolve () {
98102 printf ' %s\n' " $resolvemsg "
99103 stop_here $1
100104 fi
101- echo " When you have resolved this problem run \" $cmdline --resolved\" ."
102- echo " If you would prefer to skip this patch, instead run \" $cmdline --skip\" ."
103- echo " To restore the original branch and stop patching run \" $cmdline --abort\" ."
105+ eval_gettext " When you have resolved this problem run \"\ $ cmdline --resolved\" .
106+ If you would prefer to skip this patch, instead run \"\ $ cmdline --skip\" .
107+ To restore the original branch and stop patching run \"\ $ cmdline --abort\" ." ; echo
104108
105109 stop_here $1
106110}
@@ -114,7 +118,7 @@ go_next () {
114118
115119cannot_fallback () {
116120 echo " $1 "
117- echo " Cannot fall back to three-way merge."
121+ gettext " Cannot fall back to three-way merge." ; echo
118122 exit 1
119123}
120124
@@ -129,7 +133,7 @@ fall_back_3way () {
129133 " $dotest /patch" &&
130134 GIT_INDEX_FILE=" $dotest /patch-merge-tmp-index" \
131135 git write-tree > " $dotest /patch-merge-base+" ||
132- cannot_fallback " Repository lacks necessary blobs to fall back on 3-way merge."
136+ cannot_fallback " $( gettext " Repository lacks necessary blobs to fall back on 3-way merge." ) "
133137
134138 say Using index info to reconstruct a base tree...
135139 if GIT_INDEX_FILE=" $dotest /patch-merge-tmp-index" \
@@ -138,16 +142,16 @@ fall_back_3way () {
138142 mv " $dotest /patch-merge-base+" " $dotest /patch-merge-base"
139143 mv " $dotest /patch-merge-tmp-index" " $dotest /patch-merge-index"
140144 else
141- cannot_fallback " Did you hand edit your patch?
142- It does not apply to blobs recorded in its index."
145+ cannot_fallback " $( gettext " Did you hand edit your patch?
146+ It does not apply to blobs recorded in its index." ) "
143147 fi
144148
145149 test -f " $dotest /patch-merge-index" &&
146150 his_tree=$( GIT_INDEX_FILE=" $dotest /patch-merge-index" git write-tree) &&
147151 orig_tree=$( cat " $dotest /patch-merge-base" ) &&
148152 rm -fr " $dotest " /patch-merge-* || exit 1
149153
150- say Falling back to patching base and 3-way merge...
154+ say " $( gettext " Falling back to patching base and 3-way merge..." ) "
151155
152156 # This is not so wrong. Depending on which base we picked,
153157 # orig_tree may be wildly different from ours, but his_tree
@@ -254,7 +258,7 @@ split_patches () {
254258 stgit-series)
255259 if test $# -ne 1
256260 then
257- clean_abort " Only one StGIT patch series can be applied at once"
261+ clean_abort " $( gettext " Only one StGIT patch series can be applied at once" ) "
258262 fi
259263 series_dir=` dirname " $1 " `
260264 series_file=" $1 "
@@ -306,9 +310,9 @@ split_patches () {
306310 ;;
307311 * )
308312 if test -n " $parse_patch " ; then
309- clean_abort " Patch format $patch_format is not supported."
313+ clean_abort " $( eval_gettext " Patch format \ $ patch_format is not supported." ) "
310314 else
311- clean_abort " Patch format detection failed."
315+ clean_abort " $( gettext " Patch format detection failed." ) "
312316 fi
313317 ;;
314318 esac
358362 --rebasing)
359363 rebasing=t threeway=t keep=t scissors=f no_inbody_headers=t ;;
360364 -d|--dotest)
361- die " -d option is no longer supported. Do not use."
365+ die " $( gettext " -d option is no longer supported. Do not use." ) "
362366 ;;
363367 --resolvemsg)
364368 shift ; resolvemsg=$1 ;;
@@ -421,12 +425,12 @@ then
421425 false
422426 ;;
423427 esac ||
424- die " previous rebase directory $dotest still exists but mbox given."
428+ die " $( eval_gettext " previous rebase directory \ $ dotest still exists but mbox given." ) "
425429 resume=yes
426430
427431 case " $skip ,$abort " in
428432 t,t)
429- die " Please make up your mind. --skip or --abort?"
433+ die " $( gettext " Please make up your mind. --skip or --abort?" ) "
430434 ;;
431435 t,)
432436 git rerere clear
453457else
454458 # Make sure we are not given --skip, --resolved, nor --abort
455459 test " $skip$resolved$abort " = " " ||
456- die " Resolve operation not in progress, we are not resuming."
460+ die " $( gettext " Resolve operation not in progress, we are not resuming." ) "
457461
458462 # Start afresh.
459463 mkdir -p " $dotest " || exit
@@ -518,7 +522,7 @@ case "$resolved" in
518522 if test " $files "
519523 then
520524 test -n " $HAS_HEAD " && : > " $dotest /dirtyindex"
521- die " Dirty index: cannot apply patches (dirty: $files )"
525+ die " $( eval_gettext " Dirty index: cannot apply patches (dirty: \ $ files) " ) "
522526 fi
523527esac
524528
607611 go_next && continue
608612
609613 test -s " $dotest /patch" || {
610- echo " Patch is empty. Was it split wrong?"
611- echo " If you would prefer to skip this patch, instead run \" $cmdline --skip\" ."
612- echo " To restore the original branch and stop patching run \" $cmdline --abort\" ."
614+ eval_gettext " Patch is empty. Was it split wrong?
615+ If you would prefer to skip this patch, instead run \"\ $ cmdline --skip\" .
616+ To restore the original branch and stop patching run \"\ $ cmdline --abort\" ." ; echo
613617 stop_here $this
614618 }
615619 rm -f " $dotest /original-commit" " $dotest /author-script"
644648
645649 if test -z " $GIT_AUTHOR_EMAIL "
646650 then
647- echo " Patch does not have a valid e-mail address."
651+ gettext " Patch does not have a valid e-mail address." ; echo
648652 stop_here $this
649653 fi
650654
691695 if test " $interactive " = t
692696 then
693697 test -t 0 ||
694- die " cannot be interactive without stdin connected to a terminal."
698+ die " $( gettext " cannot be interactive without stdin connected to a terminal." ) "
695699 action=again
696700 while test " $action " = again
697701 do
698- echo " Commit Body is:"
702+ gettext " Commit Body is:" ; echo
699703 echo " --------------------------"
700704 cat " $dotest /final-commit"
701705 echo " --------------------------"
702- printf " Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
706+ # TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
707+ # in your translation. The program will only accept English
708+ # input at this point.
709+ gettext " Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
703710 read reply
704711 case " $reply " in
705712 [yY]* ) action=yes ;;
735742 stop_here $this
736743 fi
737744
738- say " Applying: $FIRSTLINE "
745+ say " $( eval_gettext " Applying: \ $ FIRSTLINE" ) "
739746
740747 case " $resolved " in
741748 ' ' )
756763 # working tree.
757764 resolved=
758765 git diff-index --quiet --cached HEAD -- && {
759- echo " No changes - did you forget to use 'git add'?"
760- echo " If there is nothing left to stage, chances are that something else"
761- echo " already introduced the same changes; you might want to skip this patch."
766+ gettext " No changes - did you forget to use 'git add'?
767+ If there is nothing left to stage, chances are that something else
768+ already introduced the same changes; you might want to skip this patch." ; echo
762769 stop_here_user_resolve $this
763770 }
764771 unmerged=$( git ls-files -u)
765772 if test -n " $unmerged "
766773 then
767- echo " You still have unmerged paths in your index"
768- echo " did you forget to use 'git add'?"
774+ gettext " You still have unmerged paths in your index
775+ did you forget to use 'git add'?" ; echo
769776 stop_here_user_resolve $this
770777 fi
771778 apply_status=0
780787 # Applying the patch to an earlier tree and merging the
781788 # result may have produced the same tree as ours.
782789 git diff-index --quiet --cached HEAD -- && {
783- say No changes -- Patch already applied.
790+ say " $( gettext " No changes -- Patch already applied." ) "
784791 go_next
785792 continue
786793 }
790797 fi
791798 if test $apply_status ! = 0
792799 then
793- printf ' Patch failed at %s %s\n ' " $msgnum " " $FIRSTLINE "
800+ eval_gettext ' Patch failed at $msgnum $FIRSTLINE' ; echo
794801 stop_here_user_resolve $this
795802 fi
796803
806813 GIT_AUTHOR_DATE=
807814 fi
808815 parent=$( git rev-parse --verify -q HEAD) ||
809- say >&2 " applying to an empty history"
816+ say >&2 " $( gettext " applying to an empty history" ) "
810817
811818 if test -n " $committer_date_is_author_date "
812819 then
0 commit comments