remote.c: mark messages for translation
The two strings are slightly modified to be consistent with the rest: die() and error() start with a lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Nov 10, 2018 at 06:16 UTC
0b9c3afdbfb62936337efc52b4007a446939b96b
1 file changed
+22
-21
remote.c
+22
-21
@@ -359,7 +359,7 @@ static int handle_config(const char *key, const char *value, void *cb)
359
return 0;
360
/* Handle remote.<name>.* variables */
361
if (*name == '/') {
362
- warning("Config remote shorthand cannot begin with '/': %s",
362
+ warning(_("config remote shorthand cannot begin with '/': %s"),
363
name);
364
return 0;
365
}
@@ -406,7 +406,7 @@ static int handle_config(const char *key, const char *value, void *cb)
406
if (!remote->receivepack)
407
remote->receivepack = v;
408
else
409
- error("more than one receivepack given, using the first");
409
+ error(_("more than one receivepack given, using the first"));
410
} else if (!strcmp(subkey, "uploadpack")) {
411
const char *v;
412
if (git_config_string(&v, key, value))
@@ -414,7 +414,7 @@ static int handle_config(const char *key, const char *value, void *cb)
414
if (!remote->uploadpack)
415
remote->uploadpack = v;
416
else
417
- error("more than one uploadpack given, using the first");
417
+ error(_("more than one uploadpack given, using the first"));
418
} else if (!strcmp(subkey, "tagopt")) {
419
if (!strcmp(value, "--no-tags"))
420
remote->fetch_tags = -1;
@@ -680,7 +680,7 @@ static int match_name_with_pattern(const char *key, const char *name,
680
size_t namelen;
681
int ret;
682
if (!kstar)
683
- die("Key '%s' of pattern had no '*'", key);
683
+ die(_("key '%s' of pattern had no '*'"), key);
684
klen = kstar - key;
685
ksuffixlen = strlen(kstar + 1);
686
namelen = strlen(name);
@@ -690,7 +690,7 @@ static int match_name_with_pattern(const char *key, const char *name,
690
struct strbuf sb = STRBUF_INIT;
691
const char *vstar = strchr(value, '*');
692
if (!vstar)
693
- die("Value '%s' of pattern has no '*'", value);
693
+ die(_("value '%s' of pattern has no '*'"), value);
694
strbuf_add(&sb, value, vstar - value);
695
strbuf_add(&sb, name + klen, namelen - klen - ksuffixlen);
696
strbuf_addstr(&sb, vstar + 1);
@@ -995,12 +995,12 @@ static int match_explicit_lhs(struct ref *src,
995
* way to delete 'other' ref at the remote end.
996
*/
997
if (try_explicit_object_name(rs->src, match) < 0)
998
- return error("src refspec %s does not match any.", rs->src);
998
+ return error(_("src refspec %s does not match any"), rs->src);
999
if (allocated_match)
1000
*allocated_match = 1;
1001
return 0;
1002
default:
1003
- return error("src refspec %s matches more than one.", rs->src);
1003
+ return error(_("src refspec %s matches more than one"), rs->src);
1004
}
1005
}
1006
@@ -1030,7 +1030,7 @@ static int match_explicit(struct ref *src, struct ref *dst,
1030
if (!dst_value ||
1031
((flag & REF_ISSYMREF) &&
1032
!starts_with(dst_value, "refs/heads/")))
1033
- die("%s cannot be resolved to branch.",
1033
+ die(_("%s cannot be resolved to branch"),
1034
matched_src->name);
1035
}
1036
@@ -1041,30 +1041,30 @@ static int match_explicit(struct ref *src, struct ref *dst,
1041
if (starts_with(dst_value, "refs/"))
1042
matched_dst = make_linked_ref(dst_value, dst_tail);
1043
else if (is_null_oid(&matched_src->new_oid))
1044
- error("unable to delete '%s': remote ref does not exist",
1044
+ error(_("unable to delete '%s': remote ref does not exist"),
1045
dst_value);
1046
else if ((dst_guess = guess_ref(dst_value, matched_src))) {
1047
matched_dst = make_linked_ref(dst_guess, dst_tail);
1048
free(dst_guess);
1049
} else
1050
- error("unable to push to unqualified destination: %s\n"
1051
- "The destination refspec neither matches an "
1052
- "existing ref on the remote nor\n"
1053
- "begins with refs/, and we are unable to "
1054
- "guess a prefix based on the source ref.",
1050
+ error(_("unable to push to unqualified destination: %s\n"
1051
+ "The destination refspec neither matches an "
1052
+ "existing ref on the remote nor\n"
1053
+ "begins with refs/, and we are unable to "
1054
+ "guess a prefix based on the source ref."),
1055
dst_value);
1056
break;
1057
default:
1058
matched_dst = NULL;
1059
- error("dst refspec %s matches more than one.",
1059
+ error(_("dst refspec %s matches more than one"),
1060
dst_value);
1061
break;
1062
}
1063
if (!matched_dst)
1064
return -1;
1065
if (matched_dst->peer_ref)
1066
- return error("dst ref %s receives from more than one src.",
1067
- matched_dst->name);
1066
+ return error(_("dst ref %s receives from more than one src"),
1067
+ matched_dst->name);
1068
else {
1069
matched_dst->peer_ref = allocated_src ?
1070
matched_src :
@@ -1750,7 +1750,7 @@ int get_fetch_map(const struct ref *remote_refs,
1750
ref_map = get_remote_ref(remote_refs, name);
1751
}
1752
if (!missing_ok && !ref_map)
1753
- die("Couldn't find remote ref %s", name);
1753
+ die(_("couldn't find remote ref %s"), name);
1754
if (ref_map) {
1755
ref_map->peer_ref = get_local_ref(refspec->dst);
1756
if (ref_map->peer_ref && refspec->force)
@@ -1763,7 +1763,7 @@ int get_fetch_map(const struct ref *remote_refs,
1763
if (!starts_with((*rmp)->peer_ref->name, "refs/") ||
1764
check_refname_format((*rmp)->peer_ref->name, 0)) {
1765
struct ref *ignore = *rmp;
1766
- error("* Ignoring funny ref '%s' locally",
1766
+ error(_("* Ignoring funny ref '%s' locally"),
1767
(*rmp)->peer_ref->name);
1768
*rmp = (*rmp)->next;
1769
free(ignore->peer_ref);
@@ -1858,7 +1858,7 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
1858
repo_init_revisions(the_repository, &revs, NULL);
1859
setup_revisions(argv.argc, argv.argv, &revs, NULL);
1860
if (prepare_revision_walk(&revs))
1861
- die("revision walk setup failed");
1861
+ die(_("revision walk setup failed"));
1862
1863
/* ... and count the commits on each side. */
1864
while (1) {
@@ -2131,7 +2131,8 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
2131
else if (!colon[1])
2132
oidclr(&entry->expect);
2133
else if (get_oid(colon + 1, &entry->expect))
2134
- return error("cannot parse expected object name '%s'", colon + 1);
2134
+ return error(_("cannot parse expected object name '%s'"),
2135
+ colon + 1);
2136
return 0;
2137
}
2138