Skip to content

Commit 045fac5

Browse files
vascoolgitster
authored andcommitted
i18n: git-parse-remote.sh: mark strings for translation
Change Makefile to include git-parse-remote.sh in LOCALIZED_SH. TODO: remove 3rd argument of error_on_missing_default_upstream function that is no longer required. Signed-off-by: Vasco Almeida <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 60ea78b commit 045fac5

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
20692069
--keyword=gettextln --keyword=eval_gettextln
20702070
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
20712071
LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
2072-
LOCALIZED_SH = $(SCRIPT_SH)
2072+
LOCALIZED_SH = $(SCRIPT_SH) git-parse-remote.sh
20732073
LOCALIZED_PERL = $(SCRIPT_PERL)
20742074

20752075
ifdef XGETTEXT_INCLUDE_TESTS

git-parse-remote.sh

+29-17
Original file line numberDiff line numberDiff line change
@@ -56,34 +56,46 @@ get_remote_merge_branch () {
5656
error_on_missing_default_upstream () {
5757
cmd="$1"
5858
op_type="$2"
59-
op_prep="$3"
59+
op_prep="$3" # FIXME: op_prep is no longer used
6060
example="$4"
6161
branch_name=$(git symbolic-ref -q HEAD)
62+
display_branch_name="${branch_name#refs/heads/}"
6263
# If there's only one remote, use that in the suggestion
63-
remote="<remote>"
64+
remote="$(gettext "<remote>")"
65+
branch="$(gettext "<branch>")"
6466
if test $(git remote | wc -l) = 1
6567
then
6668
remote=$(git remote)
6769
fi
6870

6971
if test -z "$branch_name"
7072
then
71-
echo "You are not currently on a branch. Please specify which
72-
branch you want to $op_type $op_prep. See git-${cmd}(1) for details.
73-
74-
$example
75-
"
73+
gettextln "You are not currently on a branch."
7674
else
77-
echo "There is no tracking information for the current branch.
78-
Please specify which branch you want to $op_type $op_prep.
79-
See git-${cmd}(1) for details
80-
81-
$example
82-
83-
If you wish to set tracking information for this branch you can do so with:
84-
85-
git branch --set-upstream-to=$remote/<branch> ${branch_name#refs/heads/}
86-
"
75+
gettextln "There is no tracking information for the current branch."
76+
fi
77+
case "$op_type" in
78+
rebase)
79+
gettextln "Please specify which branch you want to rebase against."
80+
;;
81+
merge)
82+
gettextln "Please specify which branch you want to merge with."
83+
;;
84+
*)
85+
echo >&2 "BUG: unknown operation type: $op_type"
86+
exit 1
87+
;;
88+
esac
89+
eval_gettextln "See git-\${cmd}(1) for details."
90+
echo
91+
echo " $example"
92+
echo
93+
if test -n "$branch_name"
94+
then
95+
gettextln "If you wish to set tracking information for this branch you can do so with:"
96+
echo
97+
echo " git branch --set-upstream-to=$remote/$branch $display_branch_name"
98+
echo
8799
fi
88100
exit 1
89101
}

0 commit comments

Comments
 (0)