From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 02/22] builtin/blame.c: mark strings for translation
Date: Sat, 27 Feb 2016 13:41:53 +0700 [thread overview]
Message-ID: <1456555333-5853-3-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1456555333-5853-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
builtin/blame.c | 58 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index e982fb8..988a38a 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -196,7 +196,7 @@ static void fill_origin_blob(struct diff_options *opt,
file->size = file_size;
if (!file->ptr)
- die("Cannot read blob %s for path %s",
+ die(_("Cannot read blob %s for path %s"),
sha1_to_hex(o->blob_sha1),
o->path);
o->file = *file;
@@ -981,7 +981,7 @@ static void pass_blame_to_parent(struct scoreboard *sb,
num_get_patch++;
if (diff_hunks(&file_p, &file_o, 0, blame_chunk_cb, &d))
- die("unable to generate diff (%s -> %s)",
+ die(_("unable to generate diff (%s -> %s)"),
oid_to_hex(&parent->commit->object.oid),
oid_to_hex(&target->commit->object.oid));
/* The rest are the same as the parent */
@@ -1130,7 +1130,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
*/
memset(split, 0, sizeof(struct blame_entry [3]));
if (diff_hunks(file_p, &file_o, 1, handle_split_cb, &d))
- die("unable to generate diff (%s)",
+ die(_("unable to generate diff (%s)"),
oid_to_hex(&parent->commit->object.oid));
/* remainder, if any, all match the preimage */
handle_split(sb, ent, d.tlno, d.plno, ent->num_lines, parent, split);
@@ -2240,7 +2240,7 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
sha1_object_info(blob_sha1, NULL) == OBJ_BLOB)
return;
}
- die("no such path '%s' in HEAD", path);
+ die(_("no such path '%s' in HEAD"), path);
}
static struct commit_list **append_parent(struct commit_list **tail, const unsigned char *sha1)
@@ -2249,7 +2249,7 @@ static struct commit_list **append_parent(struct commit_list **tail, const unsig
parent = lookup_commit_reference(sha1);
if (!parent)
- die("no such commit %s", sha1_to_hex(sha1));
+ die(_("no such commit %s"), sha1_to_hex(sha1));
return &commit_list_insert(parent, tail)->next;
}
@@ -2262,13 +2262,13 @@ static void append_merge_parents(struct commit_list **tail)
if (merge_head < 0) {
if (errno == ENOENT)
return;
- die("cannot open '%s' for reading", git_path_merge_head());
+ die(_("cannot open '%s' for reading"), git_path_merge_head());
}
while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
unsigned char sha1[20];
if (line.len < 40 || get_sha1_hex(line.buf, sha1))
- die("unknown line in '%s': %s", git_path_merge_head(), line.buf);
+ die(_("unknown line in '%s': %s"), git_path_merge_head(), line.buf);
tail = append_parent(tail, sha1);
}
close(merge_head);
@@ -2314,7 +2314,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
parent_tail = &commit->parents;
if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_sha1, NULL))
- die("no such ref: HEAD");
+ die(_("no such ref: HEAD"));
parent_tail = append_parent(parent_tail, head_sha1);
append_merge_parents(parent_tail);
@@ -2344,12 +2344,12 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
if (contents_from) {
if (stat(contents_from, &st) < 0)
- die_errno("Cannot stat '%s'", contents_from);
+ die_errno(_("Cannot stat '%s'"), contents_from);
read_from = contents_from;
}
else {
if (lstat(path, &st) < 0)
- die_errno("Cannot lstat '%s'", path);
+ die_errno(_("Cannot lstat '%s'"), path);
read_from = path;
}
mode = canon_mode(st.st_mode);
@@ -2360,21 +2360,21 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
textconv_object(read_from, mode, null_sha1, 0, &buf_ptr, &buf_len))
strbuf_attach(&buf, buf_ptr, buf_len, buf_len + 1);
else if (strbuf_read_file(&buf, read_from, st.st_size) != st.st_size)
- die_errno("cannot open or read '%s'", read_from);
+ die_errno(_("cannot open or read '%s'"), read_from);
break;
case S_IFLNK:
if (strbuf_readlink(&buf, read_from, st.st_size) < 0)
- die_errno("cannot readlink '%s'", read_from);
+ die_errno(_("cannot readlink '%s'"), read_from);
break;
default:
- die("unsupported file type %s", read_from);
+ die(_("unsupported file type %s"), read_from);
}
}
else {
/* Reading from stdin */
mode = 0;
if (strbuf_read(&buf, 0, 0) < 0)
- die_errno("failed to read from stdin");
+ die_errno(_("failed to read from stdin"));
}
convert_to_git(path, buf.buf, buf.len, &buf, 0);
origin->file.ptr = buf.buf;
@@ -2427,9 +2427,9 @@ static struct commit *find_single_final(struct rev_info *revs,
while (obj->type == OBJ_TAG)
obj = deref_tag(obj, NULL, 0);
if (obj->type != OBJ_COMMIT)
- die("Non commit %s?", revs->pending.objects[i].name);
+ die(_("Non commit %s?"), revs->pending.objects[i].name);
if (found)
- die("More than one commit to dig from %s and %s?",
+ die(_("More than one commit to dig from %s and %s?"),
revs->pending.objects[i].name, name);
found = (struct commit *)obj;
name = revs->pending.objects[i].name;
@@ -2463,16 +2463,16 @@ static char *prepare_initial(struct scoreboard *sb)
while (obj->type == OBJ_TAG)
obj = deref_tag(obj, NULL, 0);
if (obj->type != OBJ_COMMIT)
- die("Non commit %s?", revs->pending.objects[i].name);
+ die(_("Non commit %s?"), revs->pending.objects[i].name);
if (sb->final)
- die("More than one commit to dig down to %s and %s?",
+ die(_("More than one commit to dig down to %s and %s?"),
revs->pending.objects[i].name,
final_commit_name);
sb->final = (struct commit *) obj;
final_commit_name = revs->pending.objects[i].name;
}
if (!final_commit_name)
- die("No commit to dig down to?");
+ die(_("No commit to dig down to?"));
return xstrdup(final_commit_name);
}
@@ -2594,7 +2594,7 @@ parse_done:
if (incremental || (output_option & OUTPUT_PORCELAIN)) {
if (show_progress > 0)
- die("--progress can't be used with --incremental or porcelain formats");
+ die(_("--progress can't be used with --incremental or porcelain formats"));
show_progress = 0;
} else if (show_progress < 0)
show_progress = isatty(2);
@@ -2604,7 +2604,7 @@ parse_done:
abbrev++;
if (revs_file && read_ancestry(revs_file))
- die_errno("reading graft file '%s' failed", revs_file);
+ die_errno(_("reading graft file '%s' failed"), revs_file);
if (cmd_is_annotate) {
output_option |= OUTPUT_ANNOTATE_COMPAT;
@@ -2704,7 +2704,7 @@ parse_done:
setup_work_tree();
if (!file_exists(path))
- die_errno("cannot stat path '%s'", path);
+ die_errno(_("cannot stat path '%s'"), path);
}
revs.disable_stdin = 1;
@@ -2717,7 +2717,7 @@ parse_done:
sb.commits.compare = compare_commits_by_commit_date;
}
else if (contents_from)
- die("--contents and --reverse do not blend well.");
+ die(_("--contents and --reverse do not blend well."));
else {
final_commit_name = prepare_initial(&sb);
sb.commits.compare = compare_commits_by_reverse_commit_date;
@@ -2737,12 +2737,12 @@ parse_done:
add_pending_object(&revs, &(sb.final->object), ":");
}
else if (contents_from)
- die("Cannot use --contents with final commit object name");
+ die(_("Cannot use --contents with final commit object name"));
if (reverse && revs.first_parent_only) {
final_commit = find_single_final(sb.revs, NULL);
if (!final_commit)
- die("--reverse and --first-parent together require specified latest commit");
+ die(_("--reverse and --first-parent together require specified latest commit"));
}
/*
@@ -2769,7 +2769,7 @@ parse_done:
}
if (oidcmp(&c->object.oid, &sb.final->object.oid))
- die("--reverse --first-parent together require range along first-parent chain");
+ die(_("--reverse --first-parent together require range along first-parent chain"));
}
if (is_null_oid(&sb.final->object.oid)) {
@@ -2780,7 +2780,7 @@ parse_done:
else {
o = get_origin(&sb, sb.final, path);
if (fill_blob_sha1_and_mode(o))
- die("no such path %s in %s", path, final_commit_name);
+ die(_("no such path %s in %s"), path, final_commit_name);
if (DIFF_OPT_TST(&sb.revs->diffopt, ALLOW_TEXTCONV) &&
textconv_object(path, o->mode, o->blob_sha1, 1, (char **) &sb.final_buf,
@@ -2791,7 +2791,7 @@ parse_done:
&sb.final_buf_size);
if (!sb.final_buf)
- die("Cannot read blob %s for path %s",
+ die(_("Cannot read blob %s for path %s"),
sha1_to_hex(o->blob_sha1),
path);
}
@@ -2810,7 +2810,7 @@ parse_done:
&bottom, &top, sb.path))
usage(blame_usage);
if (lno < top || ((lno || bottom) && lno < bottom))
- die("file %s has only %lu lines", path, lno);
+ die(_("file %s has only %lu lines"), path, lno);
if (bottom < 1)
bottom = 1;
if (top < 1)
--
2.8.0.rc0.205.g7ec8cf1
next prev parent reply other threads:[~2016-02-27 6:42 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 01/22] credential-cache--daemon: enable localized messages Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` Nguyễn Thái Ngọc Duy [this message]
2016-02-28 18:57 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Junio C Hamano
2016-02-29 0:33 ` Duy Nguyen
2016-02-29 18:22 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 03/22] builtin/checkout.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:00 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 04/22] builtin/clone.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:05 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 05/22] builtin/config.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:25 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 06/22] " Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 07/22] builtin/update-index.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:27 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 08/22] convert.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:29 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 09/22] credential-cache--daemon.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:30 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 10/22] http.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:31 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 11/22] ident.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:34 ` Junio C Hamano
2016-03-01 14:56 ` Jeff King
2016-02-27 6:42 ` [PATCH 12/22] notes.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:36 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 13/22] ref-filter.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:41 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 14/22] refs/files-backend.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:43 ` Junio C Hamano
2016-03-01 10:40 ` Duy Nguyen
2016-02-27 6:42 ` [PATCH 15/22] remote-curl.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:50 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 16/22] run-command.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:52 ` Junio C Hamano
2016-03-01 0:00 ` Stefan Beller
2016-02-27 6:42 ` [PATCH 17/22] sha1_file.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 18/22] submodule.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 19/22] trailer.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:55 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 20/22] transport-helper.c: mark strings for translating Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 21/22] transport.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 22/22] wrapper.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 17:34 ` [PATCH 00/22] Mark more " Junio C Hamano
2016-02-27 19:00 ` Junio C Hamano
2016-02-28 0:43 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456555333-5853-3-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).