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 <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
dd509db342b8656aa9e137005639e3492f17353c
1 file changed
+19
-15
builtin/reflog.c
+19
-15
@@ -13,11 +13,15 @@
13
14
/* NEEDSWORK: switch to using parse_options */
15
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>...");
20
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>...");
23
static const char reflog_exists_usage[] =
20
-"git reflog exists <ref>";
24
+N_("git reflog exists <ref>");
25
26
static timestamp_t default_reflog_expire;
27
static timestamp_t default_reflog_expire_unreachable;
@@ -556,7 +560,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
560
break;
561
}
562
else if (arg[0] == '-')
559
- usage(reflog_expire_usage);
563
+ usage(_(reflog_expire_usage));
564
else
565
break;
566
}
@@ -569,7 +573,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
573
if (cb.cmd.stalefix) {
574
repo_init_revisions(the_repository, &cb.cmd.revs, prefix);
575
if (flags & EXPIRE_REFLOGS_VERBOSE)
572
- printf("Marking reachable objects...");
576
+ printf(_("Marking reachable objects..."));
577
mark_reachable_objects(&cb.cmd.revs, 0, 0, NULL);
578
if (flags & EXPIRE_REFLOGS_VERBOSE)
579
putchar('\n');
@@ -598,7 +602,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
602
char *ref;
603
struct object_id oid;
604
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]);
606
continue;
607
}
608
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)
648
break;
649
}
650
else if (arg[0] == '-')
647
- usage(reflog_delete_usage);
651
+ usage(_(reflog_delete_usage));
652
else
653
break;
654
}
655
656
if (argc - i < 1)
653
- return error("Nothing to delete?");
657
+ return error(_("no reflog specified to delete"));
658
659
for ( ; i < argc; i++) {
660
const char *spec = strstr(argv[i], "@{");
@@ -659,12 +663,12 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
663
int recno;
664
665
if (!spec) {
662
- status |= error("Not a reflog: %s", argv[i]);
666
+ status |= error(_("not a reflog: %s"), argv[i]);
667
continue;
668
}
669
670
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]);
672
continue;
673
}
674
@@ -699,7 +703,7 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
703
break;
704
}
705
else if (arg[0] == '-')
702
- usage(reflog_exists_usage);
706
+ usage(_(reflog_exists_usage));
707
else
708
break;
709
}
@@ -707,10 +711,10 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
711
start = i;
712
713
if (argc - start != 1)
710
- usage(reflog_exists_usage);
714
+ usage(_(reflog_exists_usage));
715
716
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]);
718
return !reflog_exists(argv[start]);
719
}
720
@@ -719,12 +723,12 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
723
*/
724
725
static const char reflog_usage[] =
722
-"git reflog [ show | expire | delete | exists ]";
726
+N_("git reflog [ show | expire | delete | exists ]");
727
728
int cmd_reflog(int argc, const char **argv, const char *prefix)
729
{
730
if (argc > 1 && !strcmp(argv[1], "-h"))
727
- usage(reflog_usage);
731
+ usage(_(reflog_usage));
732
733
/* With no command, we default to showing it. */
734
if (argc < 2 || *argv[1] == '-')