Skip to content

Commit 49a4352

Browse files
committed
Merge branch 'nd/i18n-2.8.0'
* nd/i18n-2.8.0: trailer.c: mark strings for translation ref-filter.c: mark strings for translation builtin/clone.c: mark strings for translation builtin/checkout.c: mark strings for translation
2 parents 0194200 + 13ad56f commit 49a4352

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
662662
}
663663
} else if (new->path) { /* Switch branches. */
664664
if (create_symref("HEAD", new->path, msg.buf) < 0)
665-
die("unable to update HEAD");
665+
die(_("unable to update HEAD"));
666666
if (!opts->quiet) {
667667
if (old->path && !strcmp(new->path, old->path)) {
668668
if (opts->new_branch_force)

builtin/clone.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
236236
strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git");
237237

238238
if (!len || (len == 1 && *start == '/'))
239-
die("No directory name could be guessed.\n"
240-
"Please specify a directory on the command line");
239+
die(_("No directory name could be guessed.\n"
240+
"Please specify a directory on the command line"));
241241

242242
if (is_bare)
243243
dir = xstrfmt("%.*s.git", (int)len, start);
@@ -644,7 +644,7 @@ static void update_remote_refs(const struct ref *refs,
644644
if (create_symref(head_ref.buf,
645645
remote_head_points_at->peer_ref->name,
646646
msg) < 0)
647-
die("unable to update %s", head_ref.buf);
647+
die(_("unable to update %s"), head_ref.buf);
648648
strbuf_release(&head_ref);
649649
}
650650
}
@@ -656,7 +656,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
656656
if (our && skip_prefix(our->name, "refs/heads/", &head)) {
657657
/* Local default branch link */
658658
if (create_symref("HEAD", our->name, NULL) < 0)
659-
die("unable to update HEAD");
659+
die(_("unable to update HEAD"));
660660
if (!option_bare) {
661661
update_ref(msg, "HEAD", our->old_oid.hash, NULL, 0,
662662
UPDATE_REFS_DIE_ON_ERR);
@@ -750,7 +750,7 @@ static void write_config(struct string_list *config)
750750
for (i = 0; i < config->nr; i++) {
751751
if (git_config_parse_parameter(config->items[i].string,
752752
write_one_config, NULL) < 0)
753-
die("unable to write parameters to config file");
753+
die(_("unable to write parameters to config file"));
754754
}
755755
}
756756

ref-filter.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
7474
static void body_atom_parser(struct used_atom *atom, const char *arg)
7575
{
7676
if (arg)
77-
die("%%(body) does not take arguments");
77+
die(_("%%(body) does not take arguments"));
7878
atom->u.contents.option = C_BODY_DEP;
7979
}
8080

8181
static void subject_atom_parser(struct used_atom *atom, const char *arg)
8282
{
8383
if (arg)
84-
die("%%(subject) does not take arguments");
84+
die(_("%%(subject) does not take arguments"));
8585
atom->u.contents.option = C_SUB;
8686
}
8787

@@ -241,7 +241,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
241241
if (*sp == '*' && sp < ep)
242242
sp++; /* deref */
243243
if (ep <= sp)
244-
die("malformed field name: %.*s", (int)(ep-atom), atom);
244+
die(_("malformed field name: %.*s"), (int)(ep-atom), atom);
245245

246246
/* Do we have the atom already used elsewhere? */
247247
for (i = 0; i < used_atom_cnt; i++) {
@@ -267,7 +267,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
267267
}
268268

269269
if (ARRAY_SIZE(valid_atom) <= i)
270-
die("unknown field name: %.*s", (int)(ep-atom), atom);
270+
die(_("unknown field name: %.*s"), (int)(ep-atom), atom);
271271

272272
/* Add it in, including the deref prefix */
273273
at = used_atom_cnt;
@@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
421421
int at;
422422

423423
if (!ep)
424-
return error("malformed format string %s", sp);
424+
return error(_("malformed format string %s"), sp);
425425
/* sp points at "%(" and ep points at the closing ")" */
426426
at = parse_ref_filter_atom(sp + 2, ep);
427427
cp = ep + 1;
@@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
875875
const char *start = refname;
876876

877877
if (nr < 1 || *end != '\0')
878-
die(":strip= requires a positive integer argument");
878+
die(_(":strip= requires a positive integer argument"));
879879

880880
while (remaining) {
881881
switch (*start++) {
882882
case '\0':
883-
die("ref '%s' does not have %ld components to :strip",
883+
die(_("ref '%s' does not have %ld components to :strip"),
884884
refname, nr);
885885
case '/':
886886
remaining--;
@@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
10431043
else if (skip_prefix(formatp, "strip=", &arg))
10441044
refname = strip_ref_components(refname, arg);
10451045
else
1046-
die("unknown %.*s format %s",
1046+
die(_("unknown %.*s format %s"),
10471047
(int)(formatp - name), name, formatp);
10481048
}
10491049

@@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
10631063
need_obj:
10641064
buf = get_obj(ref->objectname, &obj, &size, &eaten);
10651065
if (!buf)
1066-
die("missing object %s for %s",
1066+
die(_("missing object %s for %s"),
10671067
sha1_to_hex(ref->objectname), ref->refname);
10681068
if (!obj)
1069-
die("parse_object_buffer failed on %s for %s",
1069+
die(_("parse_object_buffer failed on %s for %s"),
10701070
sha1_to_hex(ref->objectname), ref->refname);
10711071

10721072
grab_values(ref->value, 0, obj, buf, size);
@@ -1094,10 +1094,10 @@ static void populate_value(struct ref_array_item *ref)
10941094
*/
10951095
buf = get_obj(tagged, &obj, &size, &eaten);
10961096
if (!buf)
1097-
die("missing object %s for %s",
1097+
die(_("missing object %s for %s"),
10981098
sha1_to_hex(tagged), ref->refname);
10991099
if (!obj)
1100-
die("parse_object_buffer failed on %s for %s",
1100+
die(_("parse_object_buffer failed on %s for %s"),
11011101
sha1_to_hex(tagged), ref->refname);
11021102
grab_values(ref->value, 1, obj, buf, size);
11031103
if (!eaten)
@@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
13701370
unsigned int kind;
13711371

13721372
if (flag & REF_BAD_NAME) {
1373-
warning("ignoring ref with broken name %s", refname);
1373+
warning(_("ignoring ref with broken name %s"), refname);
13741374
return 0;
13751375
}
13761376

13771377
if (flag & REF_ISBROKEN) {
1378-
warning("ignoring broken ref %s", refname);
1378+
warning(_("ignoring broken ref %s"), refname);
13791379
return 0;
13801380
}
13811381

trailer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static const char *apply_command(const char *command, const char *arg)
234234
cp.use_shell = 1;
235235

236236
if (capture_command(&cp, &buf, 1024)) {
237-
error("running trailer command '%s' failed", cmd.buf);
237+
error(_("running trailer command '%s' failed"), cmd.buf);
238238
strbuf_release(&buf);
239239
result = xstrdup("");
240240
} else {

0 commit comments

Comments
 (0)