Skip to content

Commit dd509db

Browse files
pcloudsgitster
authored andcommitted
reflog: mark strings for translation
One string "nothing to delete?" is rephrased to be more helpful. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a71806a commit dd509db

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

builtin/reflog.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313

1414
/* NEEDSWORK: switch to using parse_options */
1515
static const char reflog_expire_usage[] =
16-
"git reflog expire [--expire=<time>] [--expire-unreachable=<time>] [--rewrite] [--updateref] [--stale-fix] [--dry-run | -n] [--verbose] [--all] <refs>...";
16+
N_("git reflog expire [--expire=<time>] "
17+
"[--expire-unreachable=<time>] "
18+
"[--rewrite] [--updateref] [--stale-fix] [--dry-run | -n] "
19+
"[--verbose] [--all] <refs>...");
1720
static const char reflog_delete_usage[] =
18-
"git reflog delete [--rewrite] [--updateref] [--dry-run | -n] [--verbose] <refs>...";
21+
N_("git reflog delete [--rewrite] [--updateref] "
22+
"[--dry-run | -n] [--verbose] <refs>...");
1923
static const char reflog_exists_usage[] =
20-
"git reflog exists <ref>";
24+
N_("git reflog exists <ref>");
2125

2226
static timestamp_t default_reflog_expire;
2327
static timestamp_t default_reflog_expire_unreachable;
@@ -556,7 +560,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
556560
break;
557561
}
558562
else if (arg[0] == '-')
559-
usage(reflog_expire_usage);
563+
usage(_(reflog_expire_usage));
560564
else
561565
break;
562566
}
@@ -569,7 +573,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
569573
if (cb.cmd.stalefix) {
570574
repo_init_revisions(the_repository, &cb.cmd.revs, prefix);
571575
if (flags & EXPIRE_REFLOGS_VERBOSE)
572-
printf("Marking reachable objects...");
576+
printf(_("Marking reachable objects..."));
573577
mark_reachable_objects(&cb.cmd.revs, 0, 0, NULL);
574578
if (flags & EXPIRE_REFLOGS_VERBOSE)
575579
putchar('\n');
@@ -598,7 +602,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
598602
char *ref;
599603
struct object_id oid;
600604
if (!dwim_log(argv[i], strlen(argv[i]), &oid, &ref)) {
601-
status |= error("%s points nowhere!", argv[i]);
605+
status |= error(_("%s points nowhere!"), argv[i]);
602606
continue;
603607
}
604608
set_reflog_expiry_param(&cb.cmd, explicit_expiry, ref);
@@ -644,13 +648,13 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
644648
break;
645649
}
646650
else if (arg[0] == '-')
647-
usage(reflog_delete_usage);
651+
usage(_(reflog_delete_usage));
648652
else
649653
break;
650654
}
651655

652656
if (argc - i < 1)
653-
return error("Nothing to delete?");
657+
return error(_("no reflog specified to delete"));
654658

655659
for ( ; i < argc; i++) {
656660
const char *spec = strstr(argv[i], "@{");
@@ -659,12 +663,12 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
659663
int recno;
660664

661665
if (!spec) {
662-
status |= error("Not a reflog: %s", argv[i]);
666+
status |= error(_("not a reflog: %s"), argv[i]);
663667
continue;
664668
}
665669

666670
if (!dwim_log(argv[i], spec - argv[i], &oid, &ref)) {
667-
status |= error("no reflog for '%s'", argv[i]);
671+
status |= error(_("no reflog for '%s'"), argv[i]);
668672
continue;
669673
}
670674

@@ -699,18 +703,18 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
699703
break;
700704
}
701705
else if (arg[0] == '-')
702-
usage(reflog_exists_usage);
706+
usage(_(reflog_exists_usage));
703707
else
704708
break;
705709
}
706710

707711
start = i;
708712

709713
if (argc - start != 1)
710-
usage(reflog_exists_usage);
714+
usage(_(reflog_exists_usage));
711715

712716
if (check_refname_format(argv[start], REFNAME_ALLOW_ONELEVEL))
713-
die("invalid ref format: %s", argv[start]);
717+
die(_("invalid ref format: %s"), argv[start]);
714718
return !reflog_exists(argv[start]);
715719
}
716720

@@ -719,12 +723,12 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
719723
*/
720724

721725
static const char reflog_usage[] =
722-
"git reflog [ show | expire | delete | exists ]";
726+
N_("git reflog [ show | expire | delete | exists ]");
723727

724728
int cmd_reflog(int argc, const char **argv, const char *prefix)
725729
{
726730
if (argc > 1 && !strcmp(argv[1], "-h"))
727-
usage(reflog_usage);
731+
usage(_(reflog_usage));
728732

729733
/* With no command, we default to showing it. */
730734
if (argc < 2 || *argv[1] == '-')

0 commit comments

Comments
 (0)