i18n: git-submodule die + eval_gettext messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
May 21, 2011 at 18:44 UTC
497ee87245bfa9691fde611550b1f3f86678eda5
1 file changed
+19
-19
git-submodule.sh
+19
-19
@@ -35,7 +35,7 @@ resolve_relative_url ()
35
{
36
remote=$(get_default_remote)
37
remoteurl=$(git config "remote.$remote.url") ||
38
- die "remote ($remote) does not have a url defined in .git/config"
38
+ die "$(eval_gettext "remote (\$remote) does not have a url defined in .git/config")"
39
url="$1"
40
remoteurl=${remoteurl%/}
41
sep=/
@@ -53,7 +53,7 @@ resolve_relative_url ()
53
sep=:
54
;;
55
*)
56
- die "cannot strip one component off url '$remoteurl'"
56
+ die "$(eval_gettext "cannot strip one component off url '\$remoteurl'")"
57
;;
58
esac
59
;;
@@ -105,7 +105,7 @@ module_name()
105
name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
106
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
107
test -z "$name" &&
108
- die "No submodule mapping found in .gitmodules for path '$path'"
108
+ die "$(eval_gettext "No submodule mapping found in .gitmodules for path '\$path'")"
109
echo "$name"
110
}
111
@@ -129,7 +129,7 @@ module_clone()
129
else
130
git-clone -n "$url" "$path"
131
fi ||
132
- die "Clone of '$url' into submodule path '$path' failed"
132
+ die "$(eval_gettext "Clone of '\$url' into submodule path '\$path' failed")"
133
}
134
135
#
@@ -202,7 +202,7 @@ cmd_add()
202
realrepo=$repo
203
;;
204
*)
205
- die "repo URL: '$repo' must be absolute or begin with ./|../"
205
+ die "$(eval_gettext "repo URL: '\$repo' must be absolute or begin with ./|../")"
206
;;
207
esac
208
@@ -219,7 +219,7 @@ cmd_add()
219
s|/*$||
220
')
221
git ls-files --error-unmatch "$path" > /dev/null 2>&1 &&
222
- die "'$path' already exists in the index"
222
+ die "$(eval_gettext "'\$path' already exists in the index")"
223
224
if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
225
then
@@ -236,7 +236,7 @@ cmd_add()
236
then
237
eval_gettext "Adding existing repo at '\$path' to the index"; echo
238
else
239
- die "'$path' already exists and is not a valid git repo"
239
+ die "$(eval_gettext "'\$path' already exists and is not a valid git repo")"
240
fi
241
242
case "$repo" in
@@ -259,16 +259,16 @@ cmd_add()
259
'') git checkout -f -q ;;
260
?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
261
esac
262
- ) || die "Unable to checkout submodule '$path'"
262
+ ) || die "$(eval_gettext "Unable to checkout submodule '\$path'")"
263
fi
264
265
git add $force "$path" ||
266
- die "Failed to add submodule '$path'"
266
+ die "$(eval_gettext "Failed to add submodule '\$path'")"
267
268
git config -f .gitmodules submodule."$path".path "$path" &&
269
git config -f .gitmodules submodule."$path".url "$repo" &&
270
git add --force .gitmodules ||
271
- die "Failed to register submodule '$path'"
271
+ die "$(eval_gettext "Failed to register submodule '\$path'")"
272
}
273
274
#
@@ -318,7 +318,7 @@ cmd_foreach()
318
cmd_foreach "--recursive" "$@"
319
fi
320
) ||
321
- die "Stopping at '$path'; script returned non-zero status."
321
+ die "$(eval_gettext "Stopping at '\$path'; script returned non-zero status.")"
322
fi
323
done
324
}
@@ -361,7 +361,7 @@ cmd_init()
361
362
url=$(git config -f .gitmodules submodule."$name".url)
363
test -z "$url" &&
364
- die "No url found for submodule path '$path' in .gitmodules"
364
+ die "$(eval_gettext "No url found for submodule path '\$path' in .gitmodules")"
365
366
# Possibly a url relative to parent
367
case "$url" in
@@ -371,14 +371,14 @@ cmd_init()
371
esac
372
373
git config submodule."$name".url "$url" ||
374
- die "Failed to register url for submodule path '$path'"
374
+ die "$(eval_gettext "Failed to register url for submodule path '\$path'")"
375
376
upd="$(git config -f .gitmodules submodule."$name".update)"
377
test -z "$upd" ||
378
git config submodule."$name".update "$upd" ||
379
- die "Failed to register update mode for submodule path '$path'"
379
+ die "$(eval_gettext "Failed to register update mode for submodule path '\$path'")"
380
381
- say "Submodule '$name' ($url) registered for path '$path'"
381
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
382
done
383
}
384
@@ -474,7 +474,7 @@ cmd_update()
474
else
475
subsha1=$(clear_local_git_env; cd "$path" &&
476
git rev-parse --verify HEAD) ||
477
- die "Unable to find current revision in submodule path '$path'"
477
+ die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
478
fi
479
480
if ! test -z "$update"
@@ -498,7 +498,7 @@ cmd_update()
498
(clear_local_git_env; cd "$path" &&
499
((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
500
test -z "$rev") || git-fetch)) ||
501
- die "Unable to fetch in submodule path '$path'"
501
+ die "$(eval_gettext "Unable to fetch in submodule path '\$path'")"
502
fi
503
504
# Is this something we just cloned?
@@ -534,7 +534,7 @@ cmd_update()
534
if test -n "$recursive"
535
then
536
(clear_local_git_env; cd "$path" && eval cmd_update "$orig_flags") ||
537
- die "Failed to recurse into submodule path '$path'"
537
+ die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
538
fi
539
done
540
}
@@ -834,7 +834,7 @@ cmd_status()
834
cd "$path" &&
835
eval cmd_status "$orig_args"
836
) ||
837
- die "Failed to recurse into submodule path '$path'"
837
+ die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
838
fi
839
done
840
}