i18n: blame: mark error messages for translation

Mark error messages for translation passed to die() function. Change "Cannot" to lowercase following the usual style. Reflect changes to test by using test_i18ngrep. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vasco Almeida committed Sep 15, 2016 at 14:58 UTC e3f54bff43e61934643108ee26bfe1ad0c19c6a3
2 files changed +12 -10
builtin/blame.c
+10 -8
@@ -2601,7 +2601,7 @@ parse_done:
2601
2602 if (incremental || (output_option & OUTPUT_PORCELAIN)) {
2603 if (show_progress > 0)
2604 - die("--progress can't be used with --incremental or porcelain formats");
2604 + die(_("--progress can't be used with --incremental or porcelain formats"));
2605 show_progress = 0;
2606 } else if (show_progress < 0)
2607 show_progress = isatty(2);
@@ -2727,7 +2727,7 @@ parse_done:
2727 sb.commits.compare = compare_commits_by_commit_date;
2728 }
2729 else if (contents_from)
2730 - die("--contents and --reverse do not blend well.");
2730 + die(_("--contents and --reverse do not blend well."));
2731 else {
2732 final_commit_name = prepare_initial(&sb);
2733 sb.commits.compare = compare_commits_by_reverse_commit_date;
@@ -2747,12 +2747,12 @@ parse_done:
2747 add_pending_object(&revs, &(sb.final->object), ":");
2748 }
2749 else if (contents_from)
2750 - die("Cannot use --contents with final commit object name");
2750 + die(_("cannot use --contents with final commit object name"));
2751
2752 if (reverse && revs.first_parent_only) {
2753 final_commit = find_single_final(sb.revs, NULL);
2754 if (!final_commit)
2755 - die("--reverse and --first-parent together require specified latest commit");
2755 + die(_("--reverse and --first-parent together require specified latest commit"));
2756 }
2757
2758 /*
@@ -2779,7 +2779,7 @@ parse_done:
2779 }
2780
2781 if (oidcmp(&c->object.oid, &sb.final->object.oid))
2782 - die("--reverse --first-parent together require range along first-parent chain");
2782 + die(_("--reverse --first-parent together require range along first-parent chain"));
2783 }
2784
2785 if (is_null_oid(&sb.final->object.oid)) {
@@ -2790,7 +2790,7 @@ parse_done:
2790 else {
2791 o = get_origin(&sb, sb.final, path);
2792 if (fill_blob_sha1_and_mode(o))
2793 - die("no such path %s in %s", path, final_commit_name);
2793 + die(_("no such path %s in %s"), path, final_commit_name);
2794
2795 if (DIFF_OPT_TST(&sb.revs->diffopt, ALLOW_TEXTCONV) &&
2796 textconv_object(path, o->mode, o->blob_sha1, 1, (char **) &sb.final_buf,
@@ -2801,7 +2801,7 @@ parse_done:
2801 &sb.final_buf_size);
2802
2803 if (!sb.final_buf)
2804 - die("Cannot read blob %s for path %s",
2804 + die(_("cannot read blob %s for path %s"),
2805 sha1_to_hex(o->blob_sha1),
2806 path);
2807 }
@@ -2820,7 +2820,9 @@ parse_done:
2820 &bottom, &top, sb.path))
2821 usage(blame_usage);
2822 if (lno < top || ((lno || bottom) && lno < bottom))
2823 - die("file %s has only %lu lines", path, lno);
2823 + die(Q_("file %s has only %lu line",
2824 + "file %s has only %lu lines",
2825 + lno), path, lno);
2826 if (bottom < 1)
2827 bottom = 1;
2828 if (top < 1)
t/t8003-blame-corner-cases.sh
+2 -2
@@ -212,12 +212,12 @@ EOF
212
213 test_expect_success 'blame -L with invalid start' '
214 test_must_fail git blame -L5 tres 2>errors &&
215 - grep "has only 2 lines" errors
215 + test_i18ngrep "has only 2 lines" errors
216 '
217
218 test_expect_success 'blame -L with invalid end' '
219 test_must_fail git blame -L1,5 tres 2>errors &&
220 - grep "has only 2 lines" errors
220 + test_i18ngrep "has only 2 lines" errors
221 '
222
223 test_expect_success 'blame parses <end> part of -L' '