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 <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vasco Almeida committed Apr 19, 2016 at 13:19 UTC 045fac5845b295d76420db53078ab4af4391e988
2 files changed +30 -18
Makefile
+1 -1
@@ -2069,7 +2069,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
2069 --keyword=gettextln --keyword=eval_gettextln
2070 XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
2071 LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
2072 -LOCALIZED_SH = $(SCRIPT_SH)
2072 +LOCALIZED_SH = $(SCRIPT_SH) git-parse-remote.sh
2073 LOCALIZED_PERL = $(SCRIPT_PERL)
2074
2075 ifdef XGETTEXT_INCLUDE_TESTS
git-parse-remote.sh
+29 -17
@@ -56,11 +56,13 @@ get_remote_merge_branch () {
56 error_on_missing_default_upstream () {
57 cmd="$1"
58 op_type="$2"
59 - op_prep="$3"
59 + op_prep="$3" # FIXME: op_prep is no longer used
60 example="$4"
61 branch_name=$(git symbolic-ref -q HEAD)
62 + display_branch_name="${branch_name#refs/heads/}"
63 # If there's only one remote, use that in the suggestion
63 - remote="<remote>"
64 + remote="$(gettext "<remote>")"
65 + branch="$(gettext "<branch>")"
66 if test $(git remote | wc -l) = 1
67 then
68 remote=$(git remote)
@@ -68,22 +70,32 @@ error_on_missing_default_upstream () {
70
71 if test -z "$branch_name"
72 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."
74 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
99 fi
100 exit 1
101 }