git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 00/22] Mark more strings for translation
@ 2016-02-27  6:41 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
                   ` (22 more replies)
  0 siblings, 23 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

On Sat, Feb 27, 2016 at 6:41 AM, Junio C Hamano <gitster@pobox.com> wrote:
> In previous cycles, I often left many topics in 'next' when tagging
> this zero-th preview, but eventually merged them before the final.
> I decided to do things a bit differently for this cycle: a topic,
> once it hits 'next', will not be rewound and only refined and
> corrected with incremental updates, so the only effect such a late
> merge to 'master' before the final is that some topics are not as
> widely tested on 'master' before the final one is tagged.
>
> So this -rc0 is deliberately aggressive in that it includes all
> topics that have been cooking in 'next' that I think we can fix bugs
> that might still lurking in them before the final (it merges 25
> topics since the last batch to 'master').  The topics not merged to
> this preview, on the other hand, will not be considered for 2.8
> final, even though I might later succumb to the temptation to pick
> up ones that are in 'next' as of today ;-)

Beautiful. This allows me to fix up all i18n strings in a single
series instead of spreading them across many topics in 'next'. I'm not
sure if there's enough time for translators before release though. It
depends on how many rc- there are and how long it takes for this
series to graduate.

This series marks many strings for translation. It's a result of
looking for new strings between 1.7.2 and 'master', and sometimes
looking around touched files some more.

Most of these are wrapping _() around strings, except 01/22 (enable
gettext) and 20/22 and 21/22, which convert some more strings (they
have been in my queue for a year)

  [01/22] credential-cache--daemon: enable localized messages
  [02/22] builtin/blame.c: mark strings for translation
  [03/22] builtin/checkout.c: mark strings for translation
  [04/22] builtin/clone.c: mark strings for translation
  [05/22] builtin/config.c: mark strings for translation
  [06/22] builtin/config.c: mark strings for translation
  [07/22] builtin/update-index.c: mark strings for translation
  [08/22] convert.c: mark strings for translation
  [09/22] credential-cache--daemon.c: mark strings for translation
  [10/22] http.c: mark strings for translation
  [11/22] ident.c: mark strings for translation
  [12/22] notes.c: mark strings for translation
  [13/22] ref-filter.c: mark strings for translation
  [14/22] refs/files-backend.c: mark strings for translation
  [15/22] remote-curl.c: mark strings for translation
  [16/22] run-command.c: mark strings for translation
  [17/22] sha1_file.c: mark strings for translation
  [18/22] submodule.c: mark strings for translation
  [19/22] trailer.c: mark strings for translation
  [20/22] transport-helper.c: mark strings for translating
  [21/22] transport.c: mark strings for translating
  [22/22] wrapper.c: mark strings for translation

Total 20 files changed, 385 insertions(+), 372 deletions(-)

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH 01/22] credential-cache--daemon: enable localized messages
  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 ` Nguyễn Thái Ngọc Duy
  2016-02-27  6:41 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 credential-cache--daemon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
index caef21e..63ca7c8 100644
--- a/credential-cache--daemon.c
+++ b/credential-cache--daemon.c
@@ -263,6 +263,8 @@ int main(int argc, const char **argv)
 		OPT_END()
 	};
 
+	git_setup_gettext();
+
 	git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
 
 	argc = parse_options(argc, argv, NULL, options, usage, 0);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 02/22] builtin/blame.c: mark strings for translation
  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
  2016-02-28 18:57   ` Junio C Hamano
  2016-02-27  6:41 ` [PATCH 03/22] builtin/checkout.c: " Nguyễn Thái Ngọc Duy
                   ` (20 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

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

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 03/22] builtin/checkout.c: mark strings for translation
  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 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (19 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/checkout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index cfa66e2..efcbd8f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -662,7 +662,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
 		}
 	} else if (new->path) {	/* Switch branches. */
 		if (create_symref("HEAD", new->path, msg.buf) < 0)
-			die("unable to update HEAD");
+			die(_("unable to update HEAD"));
 		if (!opts->quiet) {
 			if (old->path && !strcmp(new->path, old->path)) {
 				if (opts->new_branch_force)
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 04/22] builtin/clone.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (2 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 03/22] builtin/checkout.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (18 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/clone.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 9ac6c01..6616392 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -236,8 +236,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
 	strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git");
 
 	if (!len || (len == 1 && *start == '/'))
-	    die("No directory name could be guessed.\n"
-		"Please specify a directory on the command line");
+		die(_("No directory name could be guessed.\n"
+		      "Please specify a directory on the command line"));
 
 	if (is_bare)
 		dir = xstrfmt("%.*s.git", (int)len, start);
@@ -644,7 +644,7 @@ static void update_remote_refs(const struct ref *refs,
 		if (create_symref(head_ref.buf,
 				  remote_head_points_at->peer_ref->name,
 				  msg) < 0)
-			die("unable to update %s", head_ref.buf);
+			die(_("unable to update %s"), head_ref.buf);
 		strbuf_release(&head_ref);
 	}
 }
@@ -656,7 +656,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
 	if (our && skip_prefix(our->name, "refs/heads/", &head)) {
 		/* Local default branch link */
 		if (create_symref("HEAD", our->name, NULL) < 0)
-			die("unable to update HEAD");
+			die(_("unable to update HEAD"));
 		if (!option_bare) {
 			update_ref(msg, "HEAD", our->old_oid.hash, NULL, 0,
 				   UPDATE_REFS_DIE_ON_ERR);
@@ -750,7 +750,7 @@ static void write_config(struct string_list *config)
 	for (i = 0; i < config->nr; i++) {
 		if (git_config_parse_parameter(config->items[i].string,
 					       write_one_config, NULL) < 0)
-			die("unable to write parameters to config file");
+			die(_("unable to write parameters to config file"));
 	}
 }
 
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 05/22] builtin/config.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (3 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 04/22] builtin/clone.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (17 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/config.c b/builtin/config.c
index ca9f834..98ca43d 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -378,7 +378,7 @@ static int get_colorbool(const char *var, int print)
 static void check_write(void)
 {
 	if (!given_config_source.file && !startup_info->have_repository)
-		die("not in a git directory");
+		die(_("not in a git directory"));
 
 	if (given_config_source.use_stdin)
 		die("writing to stdin is not supported");
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 06/22] builtin/config.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (4 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 05/22] builtin/config.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/config.c | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index 98ca43d..b07df26 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -90,7 +90,7 @@ static struct option builtin_config_options[] = {
 static void check_argc(int argc, int min, int max) {
 	if (argc >= min && argc <= max)
 		return;
-	error("wrong number of arguments");
+	error(_("wrong number of arguments"));
 	usage_with_options(builtin_config_usage, builtin_config_options);
 }
 
@@ -213,7 +213,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(key_regexp, key, REG_EXTENDED)) {
-			error("invalid key pattern: %s", key_);
+			error(_("invalid key pattern: %s"), key_);
 			free(key_regexp);
 			key_regexp = NULL;
 			ret = CONFIG_INVALID_PATTERN;
@@ -234,7 +234,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(regexp, regex_, REG_EXTENDED)) {
-			error("invalid pattern: %s", regex_);
+			error(_("invalid pattern: %s"), regex_);
 			free(regexp);
 			regexp = NULL;
 			ret = CONFIG_INVALID_PATTERN;
@@ -381,10 +381,10 @@ static void check_write(void)
 		die(_("not in a git directory"));
 
 	if (given_config_source.use_stdin)
-		die("writing to stdin is not supported");
+		die(_("writing to stdin is not supported"));
 
 	if (given_config_source.blob)
-		die("writing config blobs is not supported");
+		die(_("writing config blobs is not supported"));
 }
 
 struct urlmatch_current_candidate_value {
@@ -489,7 +489,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 	if (use_global_config + use_system_config + use_local_config +
 	    !!given_config_source.file + !!given_config_source.blob > 1) {
-		error("only one config file at a time.");
+		error(_("only one config file at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
@@ -510,7 +510,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 			 * location; error out even if XDG_CONFIG_HOME
 			 * is set and points at a sane location.
 			 */
-			die("$HOME not set");
+			die(_("$HOME not set"));
 
 		if (access_or_warn(user_config, R_OK, 0) &&
 		    xdg_config && !access_or_warn(xdg_config, R_OK, 0))
@@ -540,17 +540,17 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 	}
 
 	if (HAS_MULTI_BITS(types)) {
-		error("only one type at a time.");
+		error(_("only one type at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && types) {
-		error("--get-color and variable type are incoherent");
+		error(_("--get-color and variable type are incoherent"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if (HAS_MULTI_BITS(actions)) {
-		error("only one action at a time.");
+		error(_("only one action at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 	if (actions == 0)
@@ -563,7 +563,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		}
 	if (omit_values &&
 	    !(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
-		error("--name-only is only applicable to --list or --get-regexp");
+		error(_("--name-only is only applicable to --list or --get-regexp"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
@@ -580,10 +580,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 					    &given_config_source,
 					    respect_includes) < 0) {
 			if (given_config_source.file)
-				die_errno("unable to read config file '%s'",
+				die_errno(_("unable to read config file '%s'"),
 					  given_config_source.file);
 			else
-				die("error processing config file(s)");
+				die(_("error processing config file(s)"));
 		}
 	}
 	else if (actions == ACTION_EDIT) {
@@ -591,11 +591,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 		check_argc(argc, 0, 0);
 		if (!given_config_source.file && nongit)
-			die("not in a git directory");
+			die(_("not in a git directory"));
 		if (given_config_source.use_stdin)
-			die("editing stdin is not supported");
+			die(_("editing stdin is not supported"));
 		if (given_config_source.blob)
-			die("editing blobs is not supported");
+			die(_("editing blobs is not supported"));
 		git_config(git_default_config, NULL);
 		config_file = xstrdup(given_config_source.file ?
 				      given_config_source.file : git_path("config"));
@@ -620,8 +620,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		value = normalize_value(argv[0], argv[1]);
 		ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
 		if (ret == CONFIG_NOTHING_SET)
-			error("cannot overwrite multiple values with a single value\n"
-			"       Use a regexp, --add or --replace-all to change %s.", argv[0]);
+			error(_("cannot overwrite multiple values with a single value\n"
+				"Use a regexp, --add or --replace-all to change %s."),
+			      argv[0]);
 		return ret;
 	}
 	else if (actions == ACTION_SET_ALL) {
@@ -691,7 +692,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die("No such section!");
+			die(_("No such section!"));
 	}
 	else if (actions == ACTION_REMOVE_SECTION) {
 		int ret;
@@ -702,7 +703,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die("No such section!");
+			die(_("No such section!"));
 	}
 	else if (actions == ACTION_GET_COLOR) {
 		check_argc(argc, 1, 2);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 07/22] builtin/update-index.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (5 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 06/22] " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (15 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/update-index.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 1c94ca5..21e38a8 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1127,9 +1127,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 		break;
 	case UC_DISABLE:
 		if (git_config_get_untracked_cache() == 1)
-			warning("core.untrackedCache is set to true; "
-				"remove or change it, if you really want to "
-				"disable the untracked cache");
+			warning(_("core.untrackedCache is set to true; "
+				  "remove or change it, if you really want to "
+				  "disable the untracked cache"));
 		remove_untracked_cache(&the_index);
 		report(_("Untracked cache disabled"));
 		break;
@@ -1139,9 +1139,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 	case UC_ENABLE:
 	case UC_FORCE:
 		if (git_config_get_untracked_cache() == 0)
-			warning("core.untrackedCache is set to false; "
-				"remove or change it, if you really want to "
-				"enable the untracked cache");
+			warning(_("core.untrackedCache is set to false; "
+				  "remove or change it, if you really want to "
+				  "enable the untracked cache"));
 		add_untracked_cache(&the_index);
 		report(_("Untracked cache enabled for '%s'"), get_git_work_tree());
 		break;
@@ -1156,7 +1156,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 			unable_to_lock_die(get_index_file(), lock_error);
 		}
 		if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	rollback_lock_file(lock_file);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 08/22] convert.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (6 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 07/22] builtin/update-index.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:41 ` 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
                   ` (14 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 convert.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/convert.c b/convert.c
index f524b8d..59d03b0 100644
--- a/convert.c
+++ b/convert.c
@@ -199,9 +199,11 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
 		 */
 		if (stats->crlf) {
 			if (checksafe == SAFE_CRLF_WARN)
-				warning("CRLF will be replaced by LF in %s.\nThe file will have its original line endings in your working directory.", path);
+				warning(_("CRLF will be replaced by LF in %s.\n"
+					  "The file will have its original line "
+					  "endings in your working directory."), path);
 			else /* i.e. SAFE_CRLF_FAIL */
-				die("CRLF would be replaced by LF in %s.", path);
+				die(_("CRLF would be replaced by LF in %s."), path);
 		}
 	} else if (output_eol(crlf_action) == EOL_CRLF) {
 		/*
@@ -210,9 +212,11 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
 		 */
 		if (stats->lonelf) {
 			if (checksafe == SAFE_CRLF_WARN)
-				warning("LF will be replaced by CRLF in %s.\nThe file will have its original line endings in your working directory.", path);
+				warning(_("LF will be replaced by CRLF in %s.\n"
+					  "The file will have its original line "
+					  "endings in your working directory."), path);
 			else /* i.e. SAFE_CRLF_FAIL */
-				die("LF would be replaced by CRLF in %s", path);
+				die(_("LF would be replaced by CRLF in %s"), path);
 		}
 	}
 }
@@ -397,7 +401,7 @@ static int filter_buffer_or_fd(int in, int out, void *data)
 	child_process.out = out;
 
 	if (start_command(&child_process))
-		return error("cannot fork to run external filter %s", params->cmd);
+		return error(_("cannot fork to run external filter %s"), params->cmd);
 
 	sigchain_push(SIGPIPE, SIG_IGN);
 
@@ -415,13 +419,13 @@ static int filter_buffer_or_fd(int in, int out, void *data)
 	if (close(child_process.in))
 		write_err = 1;
 	if (write_err)
-		error("cannot feed the input to external filter %s", params->cmd);
+		error(_("cannot feed the input to external filter %s"), params->cmd);
 
 	sigchain_pop(SIGPIPE);
 
 	status = finish_command(&child_process);
 	if (status)
-		error("external filter %s failed %d", params->cmd, status);
+		error(_("external filter %s failed %d"), params->cmd, status);
 
 	strbuf_release(&cmd);
 	return (write_err || status);
@@ -462,15 +466,15 @@ static int apply_filter(const char *path, const char *src, size_t len, int fd,
 		return 0;	/* error was already reported */
 
 	if (strbuf_read(&nbuf, async.out, len) < 0) {
-		error("read from external filter %s failed", cmd);
+		error(_("read from external filter %s failed"), cmd);
 		ret = 0;
 	}
 	if (close(async.out)) {
-		error("read from external filter %s failed", cmd);
+		error(_("read from external filter %s failed"), cmd);
 		ret = 0;
 	}
 	if (finish_async(&async)) {
-		error("external filter %s failed", cmd);
+		error(_("external filter %s failed"), cmd);
 		ret = 0;
 	}
 
@@ -868,7 +872,7 @@ int convert_to_git(const char *path, const char *src, size_t len,
 
 	ret |= apply_filter(path, src, len, -1, dst, filter);
 	if (!ret && required)
-		die("%s: clean filter '%s' failed", path, ca.drv->name);
+		die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
 
 	if (ret && dst) {
 		src = dst->buf;
@@ -892,7 +896,7 @@ void convert_to_git_filter_fd(const char *path, int fd, struct strbuf *dst,
 	assert(ca.drv->clean);
 
 	if (!apply_filter(path, NULL, 0, fd, dst, ca.drv->clean))
-		die("%s: clean filter '%s' failed", path, ca.drv->name);
+		die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
 
 	crlf_to_git(path, dst->buf, dst->len, dst, ca.crlf_action, checksafe);
 	ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
@@ -932,7 +936,7 @@ static int convert_to_working_tree_internal(const char *path, const char *src,
 
 	ret_filter = apply_filter(path, src, len, -1, dst, filter);
 	if (!ret_filter && required)
-		die("%s: smudge filter %s failed", path, ca.drv->name);
+		die(_("%s: smudge filter %s failed"), path, ca.drv->name);
 
 	return ret | ret_filter;
 }
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 09/22] credential-cache--daemon.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (7 preceding siblings ...)
  2016-02-27  6:41 ` [PATCH 08/22] convert.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (13 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 credential-cache--daemon.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
index 63ca7c8..ab33355 100644
--- a/credential-cache--daemon.c
+++ b/credential-cache--daemon.c
@@ -98,12 +98,12 @@ static int read_request(FILE *fh, struct credential *c,
 
 	strbuf_getline_lf(&item, fh);
 	if (!skip_prefix(item.buf, "action=", &p))
-		return error("client sent bogus action line: %s", item.buf);
+		return error(_("client sent bogus action line: %s"), item.buf);
 	strbuf_addstr(action, p);
 
 	strbuf_getline_lf(&item, fh);
 	if (!skip_prefix(item.buf, "timeout=", &p))
-		return error("client sent bogus timeout line: %s", item.buf);
+		return error(_("client sent bogus timeout line: %s"), item.buf);
 	*timeout = atoi(p);
 
 	if (credential_read(c, fh) < 0)
@@ -132,16 +132,16 @@ static void serve_one_client(FILE *in, FILE *out)
 		remove_credential(&c);
 	else if (!strcmp(action.buf, "store")) {
 		if (timeout < 0)
-			warning("cache client didn't specify a timeout");
+			warning(_("cache client didn't specify a timeout"));
 		else if (!c.username || !c.password)
-			warning("cache client gave us a partial credential");
+			warning(_("cache client gave us a partial credential"));
 		else {
 			remove_credential(&c);
 			cache_credential(&c, timeout);
 		}
 	}
 	else
-		warning("cache client sent unknown action: %s", action.buf);
+		warning(_("cache client sent unknown action: %s"), action.buf);
 
 	credential_clear(&c);
 	strbuf_release(&action);
@@ -160,7 +160,7 @@ static int serve_cache_loop(int fd)
 	pfd.events = POLLIN;
 	if (poll(&pfd, 1, 1000 * wakeup) < 0) {
 		if (errno != EINTR)
-			die_errno("poll failed");
+			die_errno(_("poll failed"));
 		return 1;
 	}
 
@@ -170,12 +170,12 @@ static int serve_cache_loop(int fd)
 
 		client = accept(fd, NULL, NULL);
 		if (client < 0) {
-			warning("accept failed: %s", strerror(errno));
+			warning(_("accept failed: %s"), strerror(errno));
 			return 1;
 		}
 		client2 = dup(client);
 		if (client2 < 0) {
-			warning("dup failed: %s", strerror(errno));
+			warning(_("dup failed: %s"), strerror(errno));
 			close(client);
 			return 1;
 		}
@@ -195,13 +195,13 @@ static void serve_cache(const char *socket_path, int debug)
 
 	fd = unix_stream_listen(socket_path);
 	if (fd < 0)
-		die_errno("unable to bind to '%s'", socket_path);
+		die_errno(_("unable to bind to '%s'"), socket_path);
 
 	printf("ok\n");
 	fclose(stdout);
 	if (!debug) {
 		if (!freopen("/dev/null", "w", stderr))
-			die_errno("unable to point stderr to /dev/null");
+			die_errno(_("unable to point stderr to /dev/null"));
 	}
 
 	while (serve_cache_loop(fd))
@@ -211,10 +211,10 @@ static void serve_cache(const char *socket_path, int debug)
 }
 
 static const char permissions_advice[] =
-"The permissions on your socket directory are too loose; other\n"
+N_("The permissions on your socket directory are too loose; other\n"
 "users may be able to read your cached credentials. Consider running:\n"
 "\n"
-"	chmod 0700 %s";
+"	chmod 0700 %s");
 static void init_socket_directory(const char *path)
 {
 	struct stat st;
@@ -223,7 +223,7 @@ static void init_socket_directory(const char *path)
 
 	if (!stat(dir, &st)) {
 		if (st.st_mode & 077)
-			die(permissions_advice, dir);
+			die(_(permissions_advice), dir);
 	} else {
 		/*
 		 * We must be sure to create the directory with the correct mode,
@@ -232,9 +232,9 @@ static void init_socket_directory(const char *path)
 		 * our protected socket.
 		 */
 		if (safe_create_leading_directories_const(dir) < 0)
-			die_errno("unable to create directories for '%s'", dir);
+			die_errno(_("unable to create directories for '%s'"), dir);
 		if (mkdir(dir, 0700) < 0)
-			die_errno("unable to mkdir '%s'", dir);
+			die_errno(_("unable to mkdir '%s'"), dir);
 	}
 
 	if (chdir(dir))
@@ -253,7 +253,7 @@ int main(int argc, const char **argv)
 	const char *socket_path;
 	int ignore_sighup = 0;
 	static const char *usage[] = {
-		"git-credential-cache--daemon [opts] <socket_path>",
+		N_("git-credential-cache--daemon [opts] <socket_path>"),
 		NULL
 	};
 	int debug = 0;
@@ -274,7 +274,7 @@ int main(int argc, const char **argv)
 		usage_with_options(usage, options);
 
 	if (!is_absolute_path(socket_path))
-		die("socket directory must be an absolute path");
+		die(_("socket directory must be an absolute path"));
 
 	init_socket_directory(socket_path);
 	register_tempfile(&socket_file, socket_path);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 10/22] http.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (8 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 09/22] credential-cache--daemon.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (12 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 http.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/http.c b/http.c
index 1d5e3bb..d56cb52 100644
--- a/http.c
+++ b/http.c
@@ -404,7 +404,7 @@ static void init_curl_proxy_auth(CURL *result)
 			}
 		}
 		if (i == ARRAY_SIZE(proxy_authmethods)) {
-			warning("unsupported proxy authentication method %s: using anyauth",
+			warning(_("unsupported proxy authentication method %s: using anyauth"),
 					http_proxy_authmethod);
 			curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
 		}
@@ -445,7 +445,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
 
 	rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
 	if (rc < 0)
-		warning("unable to set SO_KEEPALIVE on socket %s",
+		warning(_("unable to set SO_KEEPALIVE on socket %s"),
 			strerror(errno));
 
 	return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
@@ -469,7 +469,7 @@ static CURL *get_curl_handle(void)
 	long allowed_protocols = 0;
 
 	if (!result)
-		die("curl_easy_init failed");
+		die(_("curl_easy_init failed"));
 
 	if (!curl_ssl_verify) {
 		curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
@@ -503,7 +503,7 @@ static CURL *get_curl_handle(void)
 			}
 		}
 		if (i == ARRAY_SIZE(sslversions))
-			warning("unsupported ssl version %s: using default",
+			warning(_("unsupported ssl version %s: using default"),
 				ssl_version);
 	}
 
@@ -558,8 +558,8 @@ static CURL *get_curl_handle(void)
 	curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS, allowed_protocols);
 #else
 	if (transport_restrict_protocols())
-		warning("protocol restrictions not applied to curl redirects because\n"
-			"your curl version is too old (>= 7.19.4)");
+		warning(_("protocol restrictions not applied to curl redirects because\n"
+			  "your curl version is too old (>= 7.19.4)"));
 #endif
 
 	if (getenv("GIT_CURL_VERBOSE"))
@@ -659,7 +659,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 	free(normalized_url);
 
 	if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK)
-		die("curl_global_init failed");
+		die(_("curl_global_init failed"));
 
 	http_proactive_auth = proactive_auth;
 
@@ -681,7 +681,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 
 	curlm = curl_multi_init();
 	if (!curlm)
-		die("curl_multi_init failed");
+		die(_("curl_multi_init failed"));
 #endif
 
 	if (getenv("GIT_SSL_NO_VERIFY"))
@@ -1544,7 +1544,7 @@ static int http_get_file(const char *url, const char *filename,
 	strbuf_addf(&tmpfile, "%s.temp", filename);
 	result = fopen(tmpfile.buf, "a");
 	if (!result) {
-		error("Unable to open local file %s", tmpfile.buf);
+		error(_("Unable to open local file %s"), tmpfile.buf);
 		ret = HTTP_ERROR;
 		goto cleanup;
 	}
@@ -1601,7 +1601,7 @@ static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
 	tmp = strbuf_detach(&buf, NULL);
 
 	if (http_get_file(url, tmp, NULL) != HTTP_OK) {
-		error("Unable to get pack index %s", url);
+		error(_("Unable to get pack index %s"), url);
 		free(tmp);
 		tmp = NULL;
 	}
@@ -1778,7 +1778,7 @@ struct http_pack_request *new_http_pack_request(
 		sha1_pack_name(target->sha1));
 	preq->packfile = fopen(preq->tmpfile, "a");
 	if (!preq->packfile) {
-		error("Unable to open local file %s for pack",
+		error(_("Unable to open local file %s for pack"),
 		      preq->tmpfile);
 		goto abort;
 	}
@@ -1866,7 +1866,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
 	unlink_or_warn(freq->tmpfile);
 
 	if (freq->localfile != -1)
-		error("fd leakage in start: %d", freq->localfile);
+		error(_("fd leakage in start: %d"), freq->localfile);
 	freq->localfile = open(freq->tmpfile,
 			       O_WRONLY | O_CREAT | O_EXCL, 0666);
 	/*
@@ -1885,7 +1885,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
 	}
 
 	if (freq->localfile < 0) {
-		error("Couldn't create temporary file %s: %s",
+		error(_("Couldn't create temporary file %s: %s"),
 		      freq->tmpfile, strerror(errno));
 		goto abort;
 	}
@@ -1931,7 +1931,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
 			prev_posn = 0;
 			lseek(freq->localfile, 0, SEEK_SET);
 			if (ftruncate(freq->localfile, 0) < 0) {
-				error("Couldn't truncate temporary file %s: %s",
+				error(_("Couldn't truncate temporary file %s: %s"),
 					  freq->tmpfile, strerror(errno));
 				goto abort;
 			}
@@ -1985,7 +1985,7 @@ int finish_http_object_request(struct http_object_request *freq)
 	process_http_object_request(freq);
 
 	if (freq->http_code == 416) {
-		warning("requested range invalid; we may already have all the data.");
+		warning(_("requested range invalid; we may already have all the data."));
 	} else if (freq->curl_result != CURLE_OK) {
 		if (stat(freq->tmpfile, &st) == 0)
 			if (st.st_size == 0)
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 11/22] ident.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (9 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 10/22] http.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-29 18:34   ` Junio C Hamano
  2016-02-27  6:42 ` [PATCH 12/22] notes.c: " Nguyễn Thái Ngọc Duy
                   ` (11 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 ident.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ident.c b/ident.c
index 6e12582..367a5dc 100644
--- a/ident.c
+++ b/ident.c
@@ -75,13 +75,13 @@ static int add_mailname_host(struct strbuf *buf)
 	mailname = fopen("/etc/mailname", "r");
 	if (!mailname) {
 		if (errno != ENOENT)
-			warning("cannot open /etc/mailname: %s",
+			warning(_("cannot open /etc/mailname: %s"),
 				strerror(errno));
 		return -1;
 	}
 	if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
 		if (ferror(mailname))
-			warning("cannot read /etc/mailname: %s",
+			warning(_("cannot read /etc/mailname: %s"),
 				strerror(errno));
 		strbuf_release(&mailnamebuf);
 		fclose(mailname);
@@ -125,7 +125,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
 	char buf[1024];
 
 	if (gethostname(buf, sizeof(buf))) {
-		warning("cannot get host name: %s", strerror(errno));
+		warning(_("cannot get host name: %s"), strerror(errno));
 		strbuf_addstr(out, "(none)");
 		*is_bogus = 1;
 		return;
@@ -355,18 +355,18 @@ const char *fmt_ident(const char *name, const char *email,
 			using_default = 1;
 			if (strict && default_name_is_bogus) {
 				fputs(env_hint, stderr);
-				die("unable to auto-detect name (got '%s')", name);
+				die(_("unable to auto-detect name (got '%s')"), name);
 			}
 			if (strict && ident_use_config_only
 			    && !(ident_config_given & IDENT_NAME_GIVEN))
-				die("user.useConfigOnly set but no name given");
+				die(_("user.useConfigOnly set but no name given"));
 		}
 		if (!*name) {
 			struct passwd *pw;
 			if (strict) {
 				if (using_default)
 					fputs(env_hint, stderr);
-				die("empty ident name (for <%s>) not allowed", email);
+				die(_("empty ident name (for <%s>) not allowed"), email);
 			}
 			pw = xgetpwuid_self(NULL);
 			name = pw->pw_name;
@@ -377,11 +377,11 @@ const char *fmt_ident(const char *name, const char *email,
 		email = ident_default_email();
 		if (strict && default_email_is_bogus) {
 			fputs(env_hint, stderr);
-			die("unable to auto-detect email address (got '%s')", email);
+			die(_("unable to auto-detect email address (got '%s')"), email);
 		}
 		if (strict && ident_use_config_only
 		    && !(ident_config_given & IDENT_MAIL_GIVEN))
-			die("user.useConfigOnly set but no mail given");
+			die(_("user.useConfigOnly set but no mail given"));
 	}
 
 	strbuf_reset(&ident);
@@ -396,7 +396,7 @@ const char *fmt_ident(const char *name, const char *email,
 		strbuf_addch(&ident, ' ');
 		if (date_str && date_str[0]) {
 			if (parse_date(date_str, &ident) < 0)
-				die("invalid date format: %s", date_str);
+				die(_("invalid date format: %s"), date_str);
 		}
 		else
 			strbuf_addstr(&ident, ident_default_date());
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 12/22] notes.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (10 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 11/22] ident.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (10 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 notes.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/notes.c b/notes.c
index 88cf474..0f03f77 100644
--- a/notes.c
+++ b/notes.c
@@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
 
 	buf = fill_tree_descriptor(&desc, subtree->val_sha1);
 	if (!buf)
-		die("Could not read %s for notes-index",
+		die(_("Could not read %s for notes-index"),
 		     sha1_to_hex(subtree->val_sha1));
 
 	prefix_len = subtree->key_sha1[19];
@@ -455,8 +455,8 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
 			}
 			if (note_tree_insert(t, node, n, l, type,
 					     combine_notes_concatenate))
-				die("Failed to load %s %s into notes tree "
-				    "from %s",
+				die(_("Failed to load %s %s into notes tree "
+				      "from %s"),
 				    type == PTR_TYPE_NOTE ? "note" : "subtree",
 				    sha1_to_hex(l->key_sha1), t->ref);
 		}
@@ -942,7 +942,7 @@ void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
 	} else {
 		unsigned char sha1[20];
 		if (get_sha1(glob, sha1))
-			warning("notes ref %s is invalid", glob);
+			warning(_("notes ref %s is invalid"), glob);
 		if (!unsorted_string_list_has_string(list, glob))
 			string_list_append(list, glob);
 	}
@@ -1020,9 +1020,9 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
 	    get_sha1_treeish(notes_ref, object_sha1))
 		return;
 	if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_sha1))
-		die("Cannot use notes ref %s", notes_ref);
+		die(_("Cannot use notes ref %s"), notes_ref);
 	if (get_tree_entry(object_sha1, "", sha1, &mode))
-		die("Failed to read notes tree referenced by %s (%s)",
+		die(_("Failed to read notes tree referenced by %s (%s)"),
 		    notes_ref, sha1_to_hex(object_sha1));
 
 	hashclr(root_tree.key_sha1);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 13/22] ref-filter.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (11 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 12/22] notes.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (9 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 ref-filter.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/ref-filter.c b/ref-filter.c
index bb79d6b..bc551a7 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -74,14 +74,14 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
 static void body_atom_parser(struct used_atom *atom, const char *arg)
 {
 	if (arg)
-		die("%%(body) does not take arguments");
+		die(_("%%(body) does not take arguments"));
 	atom->u.contents.option = C_BODY_DEP;
 }
 
 static void subject_atom_parser(struct used_atom *atom, const char *arg)
 {
 	if (arg)
-		die("%%(subject) does not take arguments");
+		die(_("%%(subject) does not take arguments"));
 	atom->u.contents.option = C_SUB;
 }
 
@@ -241,7 +241,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
 	if (*sp == '*' && sp < ep)
 		sp++; /* deref */
 	if (ep <= sp)
-		die("malformed field name: %.*s", (int)(ep-atom), atom);
+		die(_("malformed field name: %.*s"), (int)(ep-atom), atom);
 
 	/* Do we have the atom already used elsewhere? */
 	for (i = 0; i < used_atom_cnt; i++) {
@@ -267,7 +267,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
 	}
 
 	if (ARRAY_SIZE(valid_atom) <= i)
-		die("unknown field name: %.*s", (int)(ep-atom), atom);
+		die(_("unknown field name: %.*s"), (int)(ep-atom), atom);
 
 	/* Add it in, including the deref prefix */
 	at = used_atom_cnt;
@@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
 		int at;
 
 		if (!ep)
-			return error("malformed format string %s", sp);
+			return error(_("malformed format string %s"), sp);
 		/* sp points at "%(" and ep points at the closing ")" */
 		at = parse_ref_filter_atom(sp + 2, ep);
 		cp = ep + 1;
@@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
 	const char *start = refname;
 
 	if (nr < 1 || *end != '\0')
-		die(":strip= requires a positive integer argument");
+		die(_(":strip= requires a positive integer argument"));
 
 	while (remaining) {
 		switch (*start++) {
 		case '\0':
-			die("ref '%s' does not have %ld components to :strip",
+			die(_("ref '%s' does not have %ld components to :strip"),
 			    refname, nr);
 		case '/':
 			remaining--;
@@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
 			else if (skip_prefix(formatp, "strip=", &arg))
 				refname = strip_ref_components(refname, arg);
 			else
-				die("unknown %.*s format %s",
+				die(_("unknown %.*s format %s"),
 				    (int)(formatp - name), name, formatp);
 		}
 
@@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
  need_obj:
 	buf = get_obj(ref->objectname, &obj, &size, &eaten);
 	if (!buf)
-		die("missing object %s for %s",
+		die(_("missing object %s for %s"),
 		    sha1_to_hex(ref->objectname), ref->refname);
 	if (!obj)
-		die("parse_object_buffer failed on %s for %s",
+		die(_("parse_object_buffer failed on %s for %s"),
 		    sha1_to_hex(ref->objectname), ref->refname);
 
 	grab_values(ref->value, 0, obj, buf, size);
@@ -1094,10 +1094,10 @@ static void populate_value(struct ref_array_item *ref)
 	 */
 	buf = get_obj(tagged, &obj, &size, &eaten);
 	if (!buf)
-		die("missing object %s for %s",
+		die(_("missing object %s for %s"),
 		    sha1_to_hex(tagged), ref->refname);
 	if (!obj)
-		die("parse_object_buffer failed on %s for %s",
+		die(_("parse_object_buffer failed on %s for %s"),
 		    sha1_to_hex(tagged), ref->refname);
 	grab_values(ref->value, 1, obj, buf, size);
 	if (!eaten)
@@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
 	unsigned int kind;
 
 	if (flag & REF_BAD_NAME) {
-		warning("ignoring ref with broken name %s", refname);
+		warning(_("ignoring ref with broken name %s"), refname);
 		return 0;
 	}
 
 	if (flag & REF_ISBROKEN) {
-		warning("ignoring broken ref %s", refname);
+		warning(_("ignoring broken ref %s"), refname);
 		return 0;
 	}
 
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 14/22] refs/files-backend.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (12 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 13/22] ref-filter.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-29 18:43   ` Junio C Hamano
  2016-02-27  6:42 ` [PATCH 15/22] remote-curl.c: " Nguyễn Thái Ngọc Duy
                   ` (8 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 refs/files-backend.c | 86 ++++++++++++++++++++++++++--------------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/refs/files-backend.c b/refs/files-backend.c
index 81f68f8..bf76094 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -203,7 +203,7 @@ static struct ref_entry *create_ref_entry(const char *refname,
 
 	if (check_name &&
 	    check_refname_format(refname, REFNAME_ALLOW_ONELEVEL))
-		die("Reference has invalid format: '%s'", refname);
+		die(_("Reference has invalid format: '%s'"), refname);
 	FLEX_ALLOC_STR(ref, name, refname);
 	hashcpy(ref->u.value.oid.hash, sha1);
 	oidclr(&ref->u.value.peeled);
@@ -475,12 +475,12 @@ static int is_dup_ref(const struct ref_entry *ref1, const struct ref_entry *ref2
 
 	if ((ref1->flag & REF_DIR) || (ref2->flag & REF_DIR))
 		/* This is impossible by construction */
-		die("Reference directory conflict: %s", ref1->name);
+		die(_("Reference directory conflict: %s"), ref1->name);
 
 	if (oidcmp(&ref1->u.value.oid, &ref2->u.value.oid))
-		die("Duplicated ref, and SHA1s don't match: %s", ref1->name);
+		die(_("Duplicated ref, and SHA1s don't match: %s"), ref1->name);
 
-	warning("Duplicated ref: %s", ref1->name);
+	warning(_("Duplicated ref: %s"), ref1->name);
 	return 1;
 }
 
@@ -526,7 +526,7 @@ static int ref_resolves_to_object(struct ref_entry *entry)
 	if (entry->flag & REF_ISBROKEN)
 		return 0;
 	if (!has_sha1_file(entry->u.value.oid.hash)) {
-		error("%s does not point to a valid object!", entry->name);
+		error(_("%s does not point to a valid object!"), entry->name);
 		return 0;
 	}
 	return 1;
@@ -653,7 +653,7 @@ static int do_for_each_entry_in_dirs(struct ref_dir *dir1,
 				i1++;
 				i2++;
 			} else {
-				die("conflict between reference and directory: %s",
+				die(_("conflict between reference and directory: %s"),
 				    e1->name);
 			}
 		} else {
@@ -914,7 +914,7 @@ static void clear_packed_ref_cache(struct ref_cache *refs)
 		struct packed_ref_cache *packed_refs = refs->packed;
 
 		if (packed_refs->lock)
-			die("internal error: packed-ref cache cleared while locked");
+			die(_("internal error: packed-ref cache cleared while locked"));
 		refs->packed = NULL;
 		release_packed_ref_cache(packed_refs);
 	}
@@ -1069,7 +1069,7 @@ static void read_packed_refs(FILE *f, struct ref_dir *dir)
 
 			if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
 				if (!refname_is_safe(refname))
-					die("packed refname is dangerous: %s", refname);
+					die(_("packed refname is dangerous: %s"), refname);
 				hashclr(sha1);
 				flag |= REF_BAD_NAME | REF_ISBROKEN;
 			}
@@ -1239,7 +1239,7 @@ static void read_loose_refs(const char *dirname, struct ref_dir *dir)
 			if (check_refname_format(refname.buf,
 						 REFNAME_ALLOW_ONELEVEL)) {
 				if (!refname_is_safe(refname.buf))
-					die("loose refname is dangerous: %s", refname.buf);
+					die(_("loose refname is dangerous: %s"), refname.buf);
 				hashclr(sha1);
 				flag |= REF_BAD_NAME | REF_ISBROKEN;
 			}
@@ -2099,7 +2099,7 @@ static int commit_packed_refs(void)
 
 	out = fdopen_lock_file(packed_ref_cache->lock, "w");
 	if (!out)
-		die_errno("unable to fdopen packed-refs descriptor");
+		die_errno(_("unable to fdopen packed-refs descriptor"));
 
 	fprintf_or_die(out, "%s", PACKED_REFS_HEADER);
 	do_for_each_entry_in_dir(get_packed_ref_dir(packed_ref_cache),
@@ -2275,7 +2275,7 @@ int pack_refs(unsigned int flags)
 				 pack_if_possible_fn, &cbdata);
 
 	if (commit_packed_refs())
-		die_errno("unable to overwrite old ref-pack file");
+		die_errno(_("unable to overwrite old ref-pack file"));
 
 	prune_refs(cbdata.ref_to_prune);
 	return 0;
@@ -2417,7 +2417,7 @@ static int rename_tmp_log(const char *newrefname)
 			goto retry;
 		/* fall through */
 	default:
-		error("unable to create directory for %s", newrefname);
+		error(_("unable to create directory for %s"), newrefname);
 		goto out;
 	}
 
@@ -2429,7 +2429,7 @@ static int rename_tmp_log(const char *newrefname)
 			 * Solaris 5.8 gives ENOTDIR.  Sheesh.
 			 */
 			if (remove_empty_directories(&path)) {
-				error("Directory not empty: logs/%s", newrefname);
+				error(_("Directory not empty: logs/%s"), newrefname);
 				goto out;
 			}
 			goto retry;
@@ -2441,8 +2441,8 @@ static int rename_tmp_log(const char *newrefname)
 			 */
 			goto retry;
 		} else {
-			error("unable to move logfile "TMP_RENAMED_LOG" to logs/%s: %s",
-				newrefname, strerror(errno));
+			error(_("unable to move logfile %s to logs/%s: %s"),
+				TMP_RENAMED_LOG, newrefname, strerror(errno));
 			goto out;
 		}
 	}
@@ -2486,25 +2486,25 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
 	struct strbuf err = STRBUF_INIT;
 
 	if (log && S_ISLNK(loginfo.st_mode))
-		return error("reflog for %s is a symlink", oldrefname);
+		return error(_("reflog for %s is a symlink"), oldrefname);
 
 	symref = resolve_ref_unsafe(oldrefname, RESOLVE_REF_READING,
 				    orig_sha1, &flag);
 	if (flag & REF_ISSYMREF)
-		return error("refname %s is a symbolic ref, renaming it is not supported",
+		return error(_("refname %s is a symbolic ref, renaming it is not supported"),
 			oldrefname);
 	if (!symref)
-		return error("refname %s not found", oldrefname);
+		return error(_("refname %s not found"), oldrefname);
 
 	if (!rename_ref_available(oldrefname, newrefname))
 		return 1;
 
 	if (log && rename(git_path("logs/%s", oldrefname), git_path(TMP_RENAMED_LOG)))
-		return error("unable to move logfile logs/%s to "TMP_RENAMED_LOG": %s",
-			oldrefname, strerror(errno));
+		return error(_("unable to move logfile logs/%s to %s: %s"),
+			     TMP_RENAMED_LOG, oldrefname, strerror(errno));
 
 	if (delete_ref(oldrefname, orig_sha1, REF_NODEREF)) {
-		error("unable to delete old %s", oldrefname);
+		error(_("unable to delete old %s"), oldrefname);
 		goto rollback;
 	}
 
@@ -2519,11 +2519,11 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
 			strbuf_release(&path);
 
 			if (result) {
-				error("Directory not empty: %s", newrefname);
+				error(_("Directory not empty: %s"), newrefname);
 				goto rollback;
 			}
 		} else {
-			error("unable to delete existing %s", newrefname);
+			error(_("unable to delete existing %s"), newrefname);
 			goto rollback;
 		}
 	}
@@ -2535,7 +2535,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
 
 	lock = lock_ref_sha1_basic(newrefname, NULL, NULL, NULL, 0, NULL, &err);
 	if (!lock) {
-		error("unable to rename '%s' to '%s': %s", oldrefname, newrefname, err.buf);
+		error(_("unable to rename '%s' to '%s': %s"), oldrefname, newrefname, err.buf);
 		strbuf_release(&err);
 		goto rollback;
 	}
@@ -2543,7 +2543,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
 
 	if (write_ref_to_lockfile(lock, orig_sha1, &err) ||
 	    commit_ref_update(lock, orig_sha1, logmsg, 0, &err)) {
-		error("unable to write current sha1 into %s: %s", newrefname, err.buf);
+		error(_("unable to write current sha1 into %s: %s"), newrefname, err.buf);
 		strbuf_release(&err);
 		goto rollback;
 	}
@@ -2553,7 +2553,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
  rollback:
 	lock = lock_ref_sha1_basic(oldrefname, NULL, NULL, NULL, 0, NULL, &err);
 	if (!lock) {
-		error("unable to lock %s for rollback: %s", oldrefname, err.buf);
+		error(_("unable to lock %s for rollback: %s"), oldrefname, err.buf);
 		strbuf_release(&err);
 		goto rollbacklog;
 	}
@@ -2562,19 +2562,19 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
 	log_all_ref_updates = 0;
 	if (write_ref_to_lockfile(lock, orig_sha1, &err) ||
 	    commit_ref_update(lock, orig_sha1, NULL, 0, &err)) {
-		error("unable to write current sha1 into %s: %s", oldrefname, err.buf);
+		error(_("unable to write current sha1 into %s: %s"), oldrefname, err.buf);
 		strbuf_release(&err);
 	}
 	log_all_ref_updates = flag;
 
  rollbacklog:
 	if (logmoved && rename(git_path("logs/%s", newrefname), git_path("logs/%s", oldrefname)))
-		error("unable to restore logfile %s from %s: %s",
+		error(_("unable to restore logfile %s from %s: %s"),
 			oldrefname, newrefname, strerror(errno));
 	if (!logmoved && log &&
 	    rename(git_path(TMP_RENAMED_LOG), git_path("logs/%s", oldrefname)))
-		error("unable to restore logfile %s from "TMP_RENAMED_LOG": %s",
-			oldrefname, strerror(errno));
+		error(_("unable to restore logfile %s from %s: %s"),
+		      TMP_RENAMED_LOG, oldrefname, strerror(errno));
 
 	return 1;
 }
@@ -2817,7 +2817,7 @@ static int commit_ref_update(struct ref_lock *lock,
 		}
 	}
 	if (commit_ref(lock)) {
-		error("Couldn't set %s", lock->ref_name);
+		error(_("Couldn't set %s"), lock->ref_name);
 		unlock_ref(lock);
 		return -1;
 	}
@@ -2862,7 +2862,7 @@ static int create_symref_locked(struct ref_lock *lock, const char *refname,
 	}
 
 	if (!fdopen_lock_file(lock->lk, "w"))
-		return error("unable to fdopen %s: %s",
+		return error(_("unable to fdopen %s: %s"),
 			     lock->lk->tempfile.filename.buf, strerror(errno));
 
 	update_symref_reflog(lock, refname, target, logmsg);
@@ -2870,7 +2870,7 @@ static int create_symref_locked(struct ref_lock *lock, const char *refname,
 	/* no error check; commit_ref will check ferror */
 	fprintf(lock->lk->tempfile.fp, "ref: %s\n", target);
 	if (commit_ref(lock) < 0)
-		return error("unable to write symref for %s: %s", refname,
+		return error(_("unable to write symref for %s: %s"), refname,
 			     strerror(errno));
 	return 0;
 }
@@ -2959,7 +2959,7 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void
 
 	/* Jump to the end */
 	if (fseek(logfp, 0, SEEK_END) < 0)
-		return error("cannot seek back reflog for %s: %s",
+		return error(_("cannot seek back reflog for %s: %s"),
 			     refname, strerror(errno));
 	pos = ftell(logfp);
 	while (!ret && 0 < pos) {
@@ -2971,11 +2971,11 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void
 		/* Fill next block from the end */
 		cnt = (sizeof(buf) < pos) ? sizeof(buf) : pos;
 		if (fseek(logfp, pos - cnt, SEEK_SET))
-			return error("cannot seek back reflog for %s: %s",
+			return error(_("cannot seek back reflog for %s: %s"),
 				     refname, strerror(errno));
 		nread = fread(buf, cnt, 1, logfp);
 		if (nread != 1)
-			return error("cannot read %d bytes from reflog for %s: %s",
+			return error(_("cannot read %d bytes from reflog for %s: %s"),
 				     cnt, refname, strerror(errno));
 		pos -= cnt;
 
@@ -3097,7 +3097,7 @@ static int do_for_each_reflog(struct strbuf *name, each_ref_fn fn, void *cb_data
 				struct object_id oid;
 
 				if (read_ref_full(name->buf, 0, oid.hash, NULL))
-					retval = error("bad ref for %s", name->buf);
+					retval = error(_("bad ref for %s"), name->buf);
 				else
 					retval = fn(name->buf, &oid, 0, cb_data);
 			}
@@ -3447,7 +3447,7 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
 	 */
 	lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err);
 	if (!lock) {
-		error("cannot lock ref '%s': %s", refname, err.buf);
+		error(_("cannot lock ref '%s': %s"), refname, err.buf);
 		strbuf_release(&err);
 		return -1;
 	}
@@ -3474,7 +3474,7 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
 		}
 		cb.newlog = fdopen_lock_file(&reflog_lock, "w");
 		if (!cb.newlog) {
-			error("cannot fdopen %s (%s)",
+			error(_("cannot fdopen %s (%s)"),
 			      get_lock_file_path(&reflog_lock), strerror(errno));
 			goto failure;
 		}
@@ -3497,21 +3497,21 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
 			!is_null_sha1(cb.last_kept_sha1);
 
 		if (close_lock_file(&reflog_lock)) {
-			status |= error("couldn't write %s: %s", log_file,
+			status |= error(_("couldn't write %s: %s"), log_file,
 					strerror(errno));
 		} else if (update &&
 			   (write_in_full(get_lock_file_fd(lock->lk),
 				sha1_to_hex(cb.last_kept_sha1), 40) != 40 ||
 			    write_str_in_full(get_lock_file_fd(lock->lk), "\n") != 1 ||
 			    close_ref(lock) < 0)) {
-			status |= error("couldn't write %s",
+			status |= error(_("couldn't write %s"),
 					get_lock_file_path(lock->lk));
 			rollback_lock_file(&reflog_lock);
 		} else if (commit_lock_file(&reflog_lock)) {
-			status |= error("unable to write reflog '%s' (%s)",
+			status |= error(_("unable to write reflog '%s' (%s)"),
 					log_file, strerror(errno));
 		} else if (update && commit_ref(lock)) {
-			status |= error("couldn't set %s", lock->ref_name);
+			status |= error(_("couldn't set %s"), lock->ref_name);
 		}
 	}
 	free(log_file);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 15/22] remote-curl.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (13 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 14/22] refs/files-backend.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (7 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 remote-curl.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/remote-curl.c b/remote-curl.c
index 15e48e2..d5b33aa 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -177,7 +177,7 @@ static struct ref *parse_info_refs(struct discovery *heads)
 			mid = &data[i];
 		if (data[i] == '\n') {
 			if (mid - start != 40)
-				die("%sinfo/refs not valid: is this a git repository?",
+				die(_("%sinfo/refs not valid: is this a git repository?"),
 				    url.buf);
 			data[i] = 0;
 			ref_name = mid + 1;
@@ -285,13 +285,13 @@ static struct discovery *discover_refs(const char *service, int for_push)
 		break;
 	case HTTP_MISSING_TARGET:
 		show_http_message(&type, &charset, &buffer);
-		die("repository '%s' not found", url.buf);
+		die(_("repository '%s' not found"), url.buf);
 	case HTTP_NOAUTH:
 		show_http_message(&type, &charset, &buffer);
-		die("Authentication failed for '%s'", url.buf);
+		die(_("Authentication failed for '%s'"), url.buf);
 	default:
 		show_http_message(&type, &charset, &buffer);
-		die("unable to access '%s': %s", url.buf, curl_errorstr);
+		die(_("unable to access '%s': %s"), url.buf, curl_errorstr);
 	}
 
 	last= xcalloc(1, sizeof(*last_discovery));
@@ -314,7 +314,7 @@ static struct discovery *discover_refs(const char *service, int for_push)
 		strbuf_reset(&exp);
 		strbuf_addf(&exp, "# service=%s", service);
 		if (strcmp(line, exp.buf))
-			die("invalid server response; got '%s'", line);
+			die(_("invalid server response; got '%s'"), line);
 		strbuf_release(&exp);
 
 		/* The header can include additional metadata lines, up
@@ -422,7 +422,7 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
 			rpc->pos = 0;
 			return CURLIOE_OK;
 		}
-		error("unable to rewind rpc post data - try increasing http.postBuffer");
+		error(_("unable to rewind rpc post data - try increasing http.postBuffer"));
 		return CURLIOE_FAILRESTART;
 
 	default:
@@ -604,11 +604,11 @@ retry:
 
 		ret = git_deflate(&stream, Z_FINISH);
 		if (ret != Z_STREAM_END)
-			die("cannot deflate request; zlib deflate error %d", ret);
+			die(_("cannot deflate request; zlib deflate error %d"), ret);
 
 		ret = git_deflate_end_gently(&stream);
 		if (ret != Z_OK)
-			die("cannot deflate request; zlib end error %d", ret);
+			die(_("cannot deflate request; zlib end error %d"), ret);
 
 		gzip_size = stream.total_out;
 
@@ -726,7 +726,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
 
 	ALLOC_ARRAY(targets, nr_heads);
 	if (options.depth)
-		die("dumb http transport does not support --depth");
+		die(_("dumb http transport does not support --depth"));
 	for (i = 0; i < nr_heads; i++)
 		targets[i] = xstrdup(oid_to_hex(&to_fetch[i]->old_oid));
 
@@ -743,7 +743,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
 		free(targets[i]);
 	free(targets);
 
-	return ret ? error("fetch failed.") : 0;
+	return ret ? error(_("fetch failed.")) : 0;
 }
 
 static int fetch_git(struct discovery *heads,
@@ -787,7 +787,7 @@ static int fetch_git(struct discovery *heads,
 	for (i = 0; i < nr_heads; i++) {
 		struct ref *ref = to_fetch[i];
 		if (!*ref->name)
-			die("cannot fetch by sha1 over smart http");
+			die(_("cannot fetch by sha1 over smart http"));
 		packet_buf_write(&preamble, "%s %s\n",
 				 oid_to_hex(&ref->old_oid), ref->name);
 	}
@@ -832,13 +832,13 @@ static void parse_fetch(struct strbuf *buf)
 			struct object_id old_oid;
 
 			if (get_oid_hex(p, &old_oid))
-				die("protocol error: expected sha/ref, got %s'", p);
+				die(_("protocol error: expected sha/ref, got %s'"), p);
 			if (p[GIT_SHA1_HEXSZ] == ' ')
 				name = p + GIT_SHA1_HEXSZ + 1;
 			else if (!p[GIT_SHA1_HEXSZ])
 				name = "";
 			else
-				die("protocol error: expected sha/ref, got %s'", p);
+				die(_("protocol error: expected sha/ref, got %s'"), p);
 
 			ref = alloc_ref(name);
 			oidcpy(&ref->old_oid, &old_oid);
@@ -850,7 +850,7 @@ static void parse_fetch(struct strbuf *buf)
 			to_fetch[nr_heads++] = ref;
 		}
 		else
-			die("http transport does not support %s", buf->buf);
+			die(_("http transport does not support %s"), buf->buf);
 
 		strbuf_reset(buf);
 		if (strbuf_getline_lf(buf, stdin) == EOF)
@@ -886,7 +886,7 @@ static int push_dav(int nr_spec, char **specs)
 		argv_array_push(&child.args, specs[i]);
 
 	if (run_command(&child))
-		die("git-http-push failed");
+		die(_("git-http-push failed"));
 	return 0;
 }
 
@@ -962,7 +962,7 @@ static void parse_push(struct strbuf *buf)
 			specs[nr_spec++] = xstrdup(buf->buf + 5);
 		}
 		else
-			die("http transport does not support %s", buf->buf);
+			die(_("http transport does not support %s"), buf->buf);
 
 		strbuf_reset(buf);
 		if (strbuf_getline_lf(buf, stdin) == EOF)
@@ -994,7 +994,7 @@ int main(int argc, const char **argv)
 	git_extract_argv0_path(argv[0]);
 	setup_git_directory_gently(&nongit);
 	if (argc < 2) {
-		error("remote-curl: usage: git remote-curl <remote> [<url>]");
+		error(_("remote-curl: usage: git remote-curl <remote> [<url>]"));
 		return 1;
 	}
 
@@ -1017,14 +1017,14 @@ int main(int argc, const char **argv)
 
 		if (strbuf_getline_lf(&buf, stdin) == EOF) {
 			if (ferror(stdin))
-				error("remote-curl: error reading command stream from git");
+				error(_("remote-curl: error reading command stream from git"));
 			return 1;
 		}
 		if (buf.len == 0)
 			break;
 		if (starts_with(buf.buf, "fetch ")) {
 			if (nongit)
-				die("remote-curl: fetch attempted without a local repo");
+				die(_("remote-curl: fetch attempted without a local repo"));
 			parse_fetch(&buf);
 
 		} else if (!strcmp(buf.buf, "list") || starts_with(buf.buf, "list ")) {
@@ -1060,7 +1060,7 @@ int main(int argc, const char **argv)
 			printf("\n");
 			fflush(stdout);
 		} else {
-			error("remote-curl: unknown command '%s' from git", buf.buf);
+			error(_("remote-curl: unknown command '%s' from git"), buf.buf);
 			return 1;
 		}
 		strbuf_reset(&buf);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 16/22] run-command.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (14 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 15/22] remote-curl.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-29 18:52   ` Junio C Hamano
  2016-02-27  6:42 ` [PATCH 17/22] sha1_file.c: " Nguyễn Thái Ngọc Duy
                   ` (6 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 run-command.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/run-command.c b/run-command.c
index 863dad5..1ee2357 100644
--- a/run-command.c
+++ b/run-command.c
@@ -909,7 +909,7 @@ static int default_start_failure(struct child_process *cp,
 {
 	int i;
 
-	strbuf_addstr(err, "Starting a child failed:");
+	strbuf_addstr(err, _("Starting a child failed:"));
 	for (i = 0; cp->argv[i]; i++)
 		strbuf_addf(err, " %s", cp->argv[i]);
 
@@ -927,7 +927,7 @@ static int default_task_finished(int result,
 	if (!result)
 		return 0;
 
-	strbuf_addf(err, "A child failed with return code %d:", result);
+	strbuf_addf(err, _("A child failed with return code %d:"), result);
 	for (i = 0; cp->argv[i]; i++)
 		strbuf_addf(err, " %s", cp->argv[i]);
 
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 17/22] sha1_file.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (15 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 16/22] run-command.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-27  6:42 ` [PATCH 18/22] submodule.c: " Nguyễn Thái Ngọc Duy
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 sha1_file.c | 189 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 96 insertions(+), 93 deletions(-)

diff --git a/sha1_file.c b/sha1_file.c
index 0251700..f669499 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -194,7 +194,7 @@ const char *sha1_file_name(const unsigned char *sha1)
 
 	/* '/' + sha1(2) + '/' + sha1(38) + '\0' */
 	if (len + 43 > PATH_MAX)
-		die("insanely long object directory %s", objdir);
+		die(_("insanely long object directory %s"), objdir);
 	memcpy(buf, objdir, len);
 	buf[len] = '/';
 	buf[len+3] = '/';
@@ -284,8 +284,8 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base,
 
 	/* Detect cases where alternate disappeared */
 	if (!is_directory(ent->base)) {
-		error("object directory %s does not exist; "
-		      "check .git/objects/info/alternates.",
+		error(_("object directory %s does not exist; "
+			"check .git/objects/info/alternates."),
 		      ent->base);
 		free(ent);
 		return -1;
@@ -328,8 +328,8 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
 	struct strbuf objdirbuf = STRBUF_INIT;
 
 	if (depth > 5) {
-		error("%s: ignoring alternate object stores, nesting too deep.",
-				relative_base);
+		error(_("%s: ignoring alternate object stores, nesting too deep."),
+		      relative_base);
 		return;
 	}
 
@@ -343,8 +343,8 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
 		if (entry[0] == '\0' || entry[0] == '#')
 			continue;
 		if (!is_absolute_path(entry) && depth) {
-			error("%s: ignoring relative alternate object store %s",
-					relative_base, entry);
+			error(_("%s: ignoring relative alternate object store %s"),
+			      relative_base, entry);
 		} else {
 			link_alt_odb_entry(entry, relative_base, depth, objdirbuf.buf);
 		}
@@ -389,7 +389,7 @@ void add_to_alternates_file(const char *reference)
 	hold_lock_file_for_update(lock, alts, LOCK_DIE_ON_ERROR);
 	out = fdopen_lock_file(lock, "w");
 	if (!out)
-		die_errno("unable to fdopen alternates lockfile");
+		die_errno(_("unable to fdopen alternates lockfile"));
 
 	in = fopen(alts, "r");
 	if (in) {
@@ -413,12 +413,12 @@ void add_to_alternates_file(const char *reference)
 		}
 	}
 	else if (errno != ENOENT)
-		die_errno("unable to read alternates file");
+		die_errno(_("unable to read alternates file"));
 
 	if (lock) {
 		fprintf_or_die(out, "%s\n", reference);
 		if (commit_lock_file(lock))
-			die_errno("unable to move new alternates file into place");
+			die_errno(_("unable to move new alternates file into place"));
 		if (alt_odb_tail)
 			link_alt_odb_entries(reference, strlen(reference), '\n', NULL, 0);
 	}
@@ -566,7 +566,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 	idx_size = xsize_t(st.st_size);
 	if (idx_size < 4 * 256 + 20 + 20) {
 		close(fd);
-		return error("index file %s is too small", path);
+		return error(_("index file %s is too small"), path);
 	}
 	idx_map = xmmap(NULL, idx_size, PROT_READ, MAP_PRIVATE, fd, 0);
 	close(fd);
@@ -576,9 +576,9 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 		version = ntohl(hdr->idx_version);
 		if (version < 2 || version > 2) {
 			munmap(idx_map, idx_size);
-			return error("index file %s is version %"PRIu32
-				     " and is not supported by this binary"
-				     " (try upgrading GIT to a newer version)",
+			return error(_("index file %s is version %" PRIu32
+				       " and is not supported by this binary"
+				       " (try upgrading GIT to a newer version)"),
 				     path, version);
 		}
 	} else
@@ -592,7 +592,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 		uint32_t n = ntohl(index[i]);
 		if (n < nr) {
 			munmap(idx_map, idx_size);
-			return error("non-monotonic index %s", path);
+			return error(_("non-monotonic index %s"), path);
 		}
 		nr = n;
 	}
@@ -607,7 +607,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 		 */
 		if (idx_size != 4*256 + nr * 24 + 20 + 20) {
 			munmap(idx_map, idx_size);
-			return error("wrong index v1 file size in %s", path);
+			return error(_("wrong index v1 file size in %s"), path);
 		}
 	} else if (version == 2) {
 		/*
@@ -629,7 +629,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 			max_size += (nr - 1)*8;
 		if (idx_size < min_size || idx_size > max_size) {
 			munmap(idx_map, idx_size);
-			return error("wrong index v2 file size in %s", path);
+			return error(_("wrong index v2 file size in %s"), path);
 		}
 		if (idx_size != min_size &&
 		    /*
@@ -639,7 +639,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
 		     */
 		    (sizeof(off_t) <= 4)) {
 			munmap(idx_map, idx_size);
-			return error("pack too large for current definition of off_t in %s", path);
+			return error(_("pack too large for current definition of off_t in %s"), path);
 		}
 	}
 
@@ -725,7 +725,7 @@ static void mmap_limit_check(size_t length)
 			limit = SIZE_MAX;
 	}
 	if (length > limit)
-		die("attempting to mmap %"PRIuMAX" over limit %"PRIuMAX,
+		die(_("attempting to mmap %"PRIuMAX" over limit %"PRIuMAX),
 		    (uintmax_t)length, (uintmax_t)limit);
 }
 
@@ -750,7 +750,7 @@ void *xmmap(void *start, size_t length,
 {
 	void *ret = xmmap_gently(start, length, prot, flags, fd, offset);
 	if (ret == MAP_FAILED)
-		die_errno("mmap failed");
+		die_errno(_("mmap failed"));
 	return ret;
 }
 
@@ -760,7 +760,7 @@ void close_pack_windows(struct packed_git *p)
 		struct pack_window *w = p->windows;
 
 		if (w->inuse_cnt)
-			die("pack '%s' still has open windows to it",
+			die(_("pack '%s' still has open windows to it"),
 			    p->pack_name);
 		munmap(w->base, w->len);
 		pack_mapped -= w->len;
@@ -975,7 +975,7 @@ static int open_packed_git_1(struct packed_git *p)
 	long fd_flag;
 
 	if (!p->index_data && open_pack_index(p))
-		return error("packfile %s index unavailable", p->pack_name);
+		return error(_("packfile %s index unavailable"), p->pack_name);
 
 	if (!pack_max_fds) {
 		unsigned int max_fds = get_max_fd_limit();
@@ -998,44 +998,44 @@ static int open_packed_git_1(struct packed_git *p)
 	/* If we created the struct before we had the pack we lack size. */
 	if (!p->pack_size) {
 		if (!S_ISREG(st.st_mode))
-			return error("packfile %s not a regular file", p->pack_name);
+			return error(_("packfile %s not a regular file"), p->pack_name);
 		p->pack_size = st.st_size;
 	} else if (p->pack_size != st.st_size)
-		return error("packfile %s size changed", p->pack_name);
+		return error(_("packfile %s size changed"), p->pack_name);
 
 	/* We leave these file descriptors open with sliding mmap;
 	 * there is no point keeping them open across exec(), though.
 	 */
 	fd_flag = fcntl(p->pack_fd, F_GETFD, 0);
 	if (fd_flag < 0)
-		return error("cannot determine file descriptor flags");
+		return error(_("cannot determine file descriptor flags"));
 	fd_flag |= FD_CLOEXEC;
 	if (fcntl(p->pack_fd, F_SETFD, fd_flag) == -1)
-		return error("cannot set FD_CLOEXEC");
+		return error(_("cannot set FD_CLOEXEC"));
 
 	/* Verify we recognize this pack file format. */
 	if (read_in_full(p->pack_fd, &hdr, sizeof(hdr)) != sizeof(hdr))
-		return error("file %s is far too short to be a packfile", p->pack_name);
+		return error(_("file %s is far too short to be a packfile"), p->pack_name);
 	if (hdr.hdr_signature != htonl(PACK_SIGNATURE))
-		return error("file %s is not a GIT packfile", p->pack_name);
+		return error(_("file %s is not a GIT packfile"), p->pack_name);
 	if (!pack_version_ok(hdr.hdr_version))
-		return error("packfile %s is version %"PRIu32" and not"
-			" supported (try upgrading GIT to a newer version)",
+		return error(_("packfile %s is version %"PRIu32" and not"
+			       " supported (try upgrading GIT to a newer version)"),
 			p->pack_name, ntohl(hdr.hdr_version));
 
 	/* Verify the pack matches its index. */
 	if (p->num_objects != ntohl(hdr.hdr_entries))
-		return error("packfile %s claims to have %"PRIu32" objects"
-			     " while index indicates %"PRIu32" objects",
+		return error(_("packfile %s claims to have %"PRIu32" objects"
+			       " while index indicates %"PRIu32" objects"),
 			     p->pack_name, ntohl(hdr.hdr_entries),
 			     p->num_objects);
 	if (lseek(p->pack_fd, p->pack_size - sizeof(sha1), SEEK_SET) == -1)
-		return error("end of packfile %s is unavailable", p->pack_name);
+		return error(_("end of packfile %s is unavailable"), p->pack_name);
 	if (read_in_full(p->pack_fd, sha1, sizeof(sha1)) != sizeof(sha1))
-		return error("packfile %s signature is unavailable", p->pack_name);
+		return error(_("packfile %s signature is unavailable"), p->pack_name);
 	idx_sha1 = ((unsigned char *)p->index_data) + p->index_size - 40;
 	if (hashcmp(sha1, idx_sha1))
-		return error("packfile %s does not match index", p->pack_name);
+		return error(_("packfile %s does not match index"), p->pack_name);
 	return 0;
 }
 
@@ -1073,9 +1073,9 @@ unsigned char *use_pack(struct packed_git *p,
 	 * don't allow an offset too close to the end of the file.
 	 */
 	if (!p->pack_size && p->pack_fd == -1 && open_packed_git(p))
-		die("packfile %s cannot be accessed", p->pack_name);
+		die(_("packfile %s cannot be accessed"), p->pack_name);
 	if (offset > (p->pack_size - 20))
-		die("offset beyond end of packfile (truncated pack?)");
+		die(_("offset beyond end of packfile (truncated pack?)"));
 
 	if (!win || !in_window(win, offset)) {
 		if (win)
@@ -1089,7 +1089,7 @@ unsigned char *use_pack(struct packed_git *p,
 			off_t len;
 
 			if (p->pack_fd == -1 && open_packed_git(p))
-				die("packfile %s cannot be accessed", p->pack_name);
+				die(_("packfile %s cannot be accessed"), p->pack_name);
 
 			win = xcalloc(1, sizeof(*win));
 			win->offset = (offset / window_align) * window_align;
@@ -1105,9 +1105,9 @@ unsigned char *use_pack(struct packed_git *p,
 				PROT_READ, MAP_PRIVATE,
 				p->pack_fd, win->offset);
 			if (win->base == MAP_FAILED)
-				die("packfile %s cannot be mapped: %s",
-					p->pack_name,
-					strerror(errno));
+				die(_("packfile %s cannot be mapped: %s"),
+				    p->pack_name,
+				    strerror(errno));
 			if (!win->offset && win->len == p->pack_size
 				&& !p->do_not_close)
 				close_pack_fd(p);
@@ -1277,7 +1277,7 @@ static void prepare_packed_git_one(char *objdir, int local)
 	dir = opendir(path.buf);
 	if (!dir) {
 		if (errno != ENOENT)
-			error("unable to open object pack directory: %s: %s",
+			error(_("unable to open object pack directory: %s: %s"),
 			      path.buf, strerror(errno));
 		strbuf_release(&path);
 		return;
@@ -1560,7 +1560,7 @@ void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
 			*size = xsize_t(st.st_size);
 			if (!*size) {
 				/* mmap() is forbidden on empty files */
-				error("object file %s is empty", sha1_file_name(sha1));
+				error(_("object file %s is empty"), sha1_file_name(sha1));
 				return NULL;
 			}
 			map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
@@ -1583,7 +1583,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
 	shift = 4;
 	while (c & 0x80) {
 		if (len <= used || bitsizeof(long) <= shift) {
-			error("bad object header");
+			error(_("bad object header"));
 			size = used = 0;
 			break;
 		}
@@ -1679,9 +1679,9 @@ static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long s
 	}
 
 	if (status < 0)
-		error("corrupt loose object '%s'", sha1_to_hex(sha1));
+		error(_("corrupt loose object '%s'"), sha1_to_hex(sha1));
 	else if (stream->avail_in)
-		error("garbage at end of loose object '%s'",
+		error(_("garbage at end of loose object '%s'"),
 		      sha1_to_hex(sha1));
 	free(buf);
 	return NULL;
@@ -1721,7 +1721,7 @@ static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,
 	if ((flags & LOOKUP_UNKNOWN_OBJECT) && (type < 0))
 		type = 0;
 	else if (type < 0)
-		die("invalid object type");
+		die(_("invalid object type"));
 	if (oi->typep)
 		*oi->typep = type;
 
@@ -1797,7 +1797,7 @@ unsigned long get_size_from_delta(struct packed_git *p,
 		 stream.total_out < sizeof(delta_head));
 	git_inflate_end(&stream);
 	if ((st != Z_STREAM_END) && stream.total_out != sizeof(delta_head)) {
-		error("delta data unpack-initial failed");
+		error(_("delta data unpack-initial failed"));
 		return 0;
 	}
 
@@ -1974,7 +1974,7 @@ static enum object_type packed_to_object_type(struct packed_git *p,
 	case OBJ_TAG:
 		break;
 	default:
-		error("unknown object type %i at offset %"PRIuMAX" in %s",
+		error(_("unknown object type %i at offset %"PRIuMAX" in %s"),
 		      type, (uintmax_t)obj_offset, p->pack_name);
 		type = OBJ_BAD;
 	}
@@ -2284,7 +2284,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 			if (check_pack_crc(p, &w_curs, obj_offset, len, revidx->nr)) {
 				const unsigned char *sha1 =
 					nth_packed_object_sha1(p, revidx->nr);
-				error("bad packed object CRC for %s",
+				error(_("bad packed object CRC for %s"),
 				      sha1_to_hex(sha1));
 				mark_bad_packed_object(p, sha1);
 				unuse_pack(&w_curs);
@@ -2298,8 +2298,8 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 
 		base_offset = get_delta_base(p, &w_curs, &curpos, type, obj_offset);
 		if (!base_offset) {
-			error("failed to validate delta base reference "
-			      "at offset %"PRIuMAX" from %s",
+			error(_("failed to validate delta base reference "
+				"at offset %"PRIuMAX" from %s"),
 			      (uintmax_t)curpos, p->pack_name);
 			/* bail to phase 2, in hopes of recovery */
 			data = NULL;
@@ -2340,7 +2340,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 		break;
 	default:
 		data = NULL;
-		error("unknown object type %i at offset %"PRIuMAX" in %s",
+		error(_("unknown object type %i at offset %"PRIuMAX" in %s"),
 		      type, (uintmax_t)obj_offset, p->pack_name);
 	}
 
@@ -2372,8 +2372,8 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 			revidx = find_pack_revindex(p, obj_offset);
 			if (revidx) {
 				base_sha1 = nth_packed_object_sha1(p, revidx->nr);
-				error("failed to read delta base object %s"
-				      " at offset %"PRIuMAX" from %s",
+				error(_("failed to read delta base object %s"
+					" at offset %"PRIuMAX" from %s"),
 				      sha1_to_hex(base_sha1), (uintmax_t)obj_offset,
 				      p->pack_name);
 				mark_bad_packed_object(p, base_sha1);
@@ -2392,8 +2392,8 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 		delta_data = unpack_compressed_entry(p, &w_curs, curpos, delta_size);
 
 		if (!delta_data) {
-			error("failed to unpack compressed delta "
-			      "at offset %"PRIuMAX" from %s",
+			error(_("failed to unpack compressed delta "
+				"at offset %"PRIuMAX" from %s"),
 			      (uintmax_t)curpos, p->pack_name);
 			data = NULL;
 			continue;
@@ -2412,7 +2412,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
 		 * the object.
 		 */
 		if (!data)
-			error("failed to apply delta");
+			error(_("failed to apply delta"));
 
 		free(delta_data);
 	}
@@ -2660,19 +2660,19 @@ static int sha1_loose_object_info(const unsigned char *sha1,
 		*oi->disk_sizep = mapsize;
 	if ((flags & LOOKUP_UNKNOWN_OBJECT)) {
 		if (unpack_sha1_header_to_strbuf(&stream, map, mapsize, hdr, sizeof(hdr), &hdrbuf) < 0)
-			status = error("unable to unpack %s header with --allow-unknown-type",
+			status = error(_("unable to unpack %s header with --allow-unknown-type"),
 				       sha1_to_hex(sha1));
 	} else if (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)
-		status = error("unable to unpack %s header",
+		status = error(_("unable to unpack %s header"),
 			       sha1_to_hex(sha1));
 	if (status < 0)
 		; /* Do nothing */
 	else if (hdrbuf.len) {
 		if ((status = parse_sha1_header_extended(hdrbuf.buf, oi, flags)) < 0)
-			status = error("unable to parse %s header with --allow-unknown-type",
+			status = error(_("unable to parse %s header with --allow-unknown-type"),
 				       sha1_to_hex(sha1));
 	} else if ((status = parse_sha1_header_extended(hdr, oi, flags)) < 0)
-		status = error("unable to parse %s header", sha1_to_hex(sha1));
+		status = error(_("unable to parse %s header"), sha1_to_hex(sha1));
 	git_inflate_end(&stream);
 	munmap(map, mapsize);
 	if (status && oi->typep)
@@ -2777,7 +2777,7 @@ static void *read_packed_sha1(const unsigned char *sha1,
 		 * This should happen only in the presence of a corrupted
 		 * pack, and is better than failing outright.
 		 */
-		error("failed to read object %s at offset %"PRIuMAX" from %s",
+		error(_("failed to read object %s at offset %"PRIuMAX" from %s"),
 		      sha1_to_hex(sha1), (uintmax_t)e.offset, e.p->pack_name);
 		mark_bad_packed_object(e.p, sha1);
 		data = read_object(sha1, type, size);
@@ -2850,22 +2850,22 @@ void *read_sha1_file_extended(const unsigned char *sha1,
 		return data;
 
 	if (errno && errno != ENOENT)
-		die_errno("failed to read object %s", sha1_to_hex(sha1));
+		die_errno(_("failed to read object %s"), sha1_to_hex(sha1));
 
 	/* die if we replaced an object with one that does not exist */
 	if (repl != sha1)
-		die("replacement %s not found for %s",
+		die(_("replacement %s not found for %s"),
 		    sha1_to_hex(repl), sha1_to_hex(sha1));
 
 	if (has_loose_object(repl)) {
 		const char *path = sha1_file_name(sha1);
 
-		die("loose object %s (stored in %s) is corrupt",
+		die(_("loose object %s (stored in %s) is corrupt"),
 		    sha1_to_hex(repl), path);
 	}
 
 	if ((p = has_packed_and_bad(repl)) != NULL)
-		die("packed object %s (stored in %s) is corrupt",
+		die(_("packed object %s (stored in %s) is corrupt"),
 		    sha1_to_hex(repl), p->pack_name);
 
 	return NULL;
@@ -2966,22 +2966,22 @@ int finalize_object_file(const char *tmpfile, const char *filename)
 	}
 	unlink_or_warn(tmpfile);
 	if (ret) {
-		if (ret != EEXIST) {
-			return error("unable to write sha1 filename %s: %s", filename, strerror(ret));
-		}
+		if (ret != EEXIST)
+			return error(_("unable to write sha1 filename %s: %s"),
+				     filename, strerror(ret));
 		/* FIXME!!! Collision check here ? */
 	}
 
 out:
 	if (adjust_shared_perm(filename))
-		return error("unable to set permission to '%s'", filename);
+		return error(_("unable to set permission to '%s'"), filename);
 	return 0;
 }
 
 static int write_buffer(int fd, const void *buf, size_t len)
 {
 	if (write_in_full(fd, buf, len) < 0)
-		return error("file write error (%s)", strerror(errno));
+		return error(_("file write error (%s)"), strerror(errno));
 	return 0;
 }
 
@@ -3000,7 +3000,7 @@ static void close_sha1_file(int fd)
 	if (fsync_object_files)
 		fsync_or_die(fd, "sha1 file");
 	if (close(fd) != 0)
-		die_errno("error when closing sha1 file");
+		die_errno(_("error when closing sha1 file"));
 }
 
 /* Size of directory component, including the ending '/' */
@@ -3062,9 +3062,12 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 	fd = create_tmpfile(&tmp_file, filename);
 	if (fd < 0) {
 		if (errno == EACCES)
-			return error("insufficient permission for adding an object to repository database %s", get_object_directory());
+			return error(_("insufficient permission for adding "
+				       "an object to repository database %s"),
+				     get_object_directory());
 		else
-			return error("unable to create temporary file: %s", strerror(errno));
+			return error(_("unable to create temporary file: %s"),
+				     strerror(errno));
 	}
 
 	/* Set it up */
@@ -3088,19 +3091,19 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 		ret = git_deflate(&stream, Z_FINISH);
 		git_SHA1_Update(&c, in0, stream.next_in - in0);
 		if (write_buffer(fd, compressed, stream.next_out - compressed) < 0)
-			die("unable to write sha1 file");
+			die(_("unable to write sha1 file"));
 		stream.next_out = compressed;
 		stream.avail_out = sizeof(compressed);
 	} while (ret == Z_OK);
 
 	if (ret != Z_STREAM_END)
-		die("unable to deflate new object %s (%d)", sha1_to_hex(sha1), ret);
+		die(_("unable to deflate new object %s (%d)"), sha1_to_hex(sha1), ret);
 	ret = git_deflate_end_gently(&stream);
 	if (ret != Z_OK)
-		die("deflateEnd on object %s failed (%d)", sha1_to_hex(sha1), ret);
+		die(_("deflateEnd on object %s failed (%d)"), sha1_to_hex(sha1), ret);
 	git_SHA1_Final(parano_sha1, &c);
 	if (hashcmp(sha1, parano_sha1) != 0)
-		die("confused by unstable object source data for %s", sha1_to_hex(sha1));
+		die(_("confused by unstable object source data for %s"), sha1_to_hex(sha1));
 
 	close_sha1_file(fd);
 
@@ -3109,7 +3112,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 		utb.actime = mtime;
 		utb.modtime = mtime;
 		if (utime(tmp_file.buf, &utb) < 0)
-			warning("failed utime() on %s: %s",
+			warning(_("failed utime() on %s: %s"),
 				tmp_file.buf, strerror(errno));
 	}
 
@@ -3183,7 +3186,7 @@ int force_object_loose(const unsigned char *sha1, time_t mtime)
 		return 0;
 	buf = read_packed_sha1(sha1, &type, &len);
 	if (!buf)
-		return error("cannot read sha1_file for %s", sha1_to_hex(sha1));
+		return error(_("cannot read sha1_file for %s"), sha1_to_hex(sha1));
 	hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %lu", typename(type), len) + 1;
 	ret = write_loose_object(sha1, hdr, hdrlen, buf, len, mtime);
 	free(buf);
@@ -3241,7 +3244,7 @@ static void check_commit(const void *buf, size_t size)
 	struct commit c;
 	memset(&c, 0, sizeof(c));
 	if (parse_commit_buffer(&c, buf, size))
-		die("corrupt commit");
+		die(_("corrupt commit"));
 }
 
 static void check_tag(const void *buf, size_t size)
@@ -3249,7 +3252,7 @@ static void check_tag(const void *buf, size_t size)
 	struct tag t;
 	memset(&t, 0, sizeof(t));
 	if (parse_tag_buffer(&t, buf, size))
-		die("corrupt tag");
+		die(_("corrupt tag"));
 }
 
 static int index_mem(unsigned char *sha1, void *buf, size_t size,
@@ -3343,7 +3346,7 @@ static int index_core(unsigned char *sha1, int fd, size_t size,
 		if (size == read_in_full(fd, buf, size))
 			ret = index_mem(sha1, buf, size, type, path, flags);
 		else
-			ret = error("short read %s", strerror(errno));
+			ret = error(_("short read %s"), strerror(errno));
 		free(buf);
 	} else {
 		void *buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
@@ -3408,29 +3411,29 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned
 	case S_IFREG:
 		fd = open(path, O_RDONLY);
 		if (fd < 0)
-			return error("open(\"%s\"): %s", path,
+			return error(_("open(\"%s\"): %s"), path,
 				     strerror(errno));
 		if (index_fd(sha1, fd, st, OBJ_BLOB, path, flags) < 0)
-			return error("%s: failed to insert into database",
+			return error(_("%s: failed to insert into database"),
 				     path);
 		break;
 	case S_IFLNK:
 		if (strbuf_readlink(&sb, path, st->st_size)) {
 			char *errstr = strerror(errno);
-			return error("readlink(\"%s\"): %s", path,
+			return error(_("readlink(\"%s\"): %s"), path,
 			             errstr);
 		}
 		if (!(flags & HASH_WRITE_OBJECT))
 			hash_sha1_file(sb.buf, sb.len, blob_type, sha1);
 		else if (write_sha1_file(sb.buf, sb.len, blob_type, sha1))
-			return error("%s: failed to insert into database",
+			return error(_("%s: failed to insert into database"),
 				     path);
 		strbuf_release(&sb);
 		break;
 	case S_IFDIR:
 		return resolve_gitlink_ref(path, "HEAD", sha1);
 	default:
-		return error("%s: unsupported file type", path);
+		return error(_("%s: unsupported file type"), path);
 	}
 	return 0;
 }
@@ -3454,9 +3457,9 @@ void assert_sha1_type(const unsigned char *sha1, enum object_type expect)
 {
 	enum object_type type = sha1_object_info(sha1, NULL);
 	if (type < 0)
-		die("%s is not a valid object", sha1_to_hex(sha1));
+		die(_("%s is not a valid object"), sha1_to_hex(sha1));
 	if (type != expect)
-		die("%s is not a valid '%s' object", sha1_to_hex(sha1),
+		die(_("%s is not a valid '%s' object"), sha1_to_hex(sha1),
 		    typename(expect));
 }
 
@@ -3475,7 +3478,7 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
 	if (!dir) {
 		if (errno == ENOENT)
 			return 0;
-		return error("unable to open %s: %s", path->buf, strerror(errno));
+		return error(_("unable to open %s: %s"), path->buf, strerror(errno));
 	}
 
 	while ((de = readdir(dir))) {
@@ -3603,7 +3606,7 @@ static int for_each_object_in_pack(struct packed_git *p, each_packed_object_fn c
 		const unsigned char *sha1 = nth_packed_object_sha1(p, i);
 
 		if (!sha1)
-			return error("unable to get sha1 of object %u in %s",
+			return error(_("unable to get sha1 of object %u in %s"),
 				     i, p->pack_name);
 
 		r = cb(sha1, p, i, data);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 18/22] submodule.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (16 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 17/22] sha1_file.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-27  6:42 ` [PATCH 19/22] trailer.c: " Nguyễn Thái Ngọc Duy
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 submodule.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/submodule.c b/submodule.c
index 24fb81a..4dd6ab3 100644
--- a/submodule.c
+++ b/submodule.c
@@ -187,7 +187,7 @@ void gitmodules_config(void)
 		strbuf_addstr(&gitmodules_path, work_tree);
 		strbuf_addstr(&gitmodules_path, "/.gitmodules");
 		if (read_cache() < 0)
-			die("index file corrupt");
+			die(_("index file corrupt"));
 		pos = cache_name_pos(".gitmodules", 11);
 		if (pos < 0) { /* .gitmodules not found or isn't merged */
 			pos = -1 - pos;
@@ -224,7 +224,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt,
 	else if (!strcmp(arg, "dirty"))
 		DIFF_OPT_SET(diffopt, IGNORE_DIRTY_SUBMODULES);
 	else if (strcmp(arg, "none"))
-		die("bad --ignore-submodules argument: %s", arg);
+		die(_("bad --ignore-submodules argument: %s"), arg);
 }
 
 static int prepare_submodule_summary(struct rev_info *rev, const char *path,
@@ -372,7 +372,7 @@ static int submodule_needs_pushing(const char *path, const unsigned char sha1[20
 		cp.out = -1;
 		cp.dir = path;
 		if (start_command(&cp))
-			die("Could not run 'git rev-list %s --not --remotes -n 1' command in submodule %s",
+			die(_("Could not run 'git rev-list %s --not --remotes -n 1' command in submodule %s"),
 				sha1_to_hex(sha1), path);
 		if (strbuf_read(&buf, cp.out, 41))
 			needs_pushing = 1;
@@ -431,7 +431,7 @@ int find_unpushed_submodules(unsigned char new_sha1[20],
 	argv[3] = remotes_arg.buf;
 	setup_revisions(argc, argv, &rev, NULL);
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	while ((commit = get_revision(&rev)) != NULL)
 		find_unpushed_submodule_commits(commit, needs_pushing);
@@ -583,7 +583,7 @@ static void calculate_changed_submodule_paths(void)
 				   add_sha1_to_argv, &argv);
 	setup_revisions(argv.argc, argv.argv, &rev, NULL);
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	/*
 	 * Collect all submodules (whether checked out or not) for which new
@@ -685,7 +685,7 @@ static int get_next_submodule(struct child_process *cp,
 			cp->env = local_repo_env;
 			cp->git_cmd = 1;
 			if (!spf->quiet)
-				strbuf_addf(err, "Fetching submodule %s%s\n",
+				strbuf_addf(err, _("Fetching submodule %s%s\n"),
 					    spf->prefix, ce->name);
 			argv_array_init(&cp->args);
 			argv_array_pushv(&cp->args, spf->args.argv);
@@ -743,7 +743,7 @@ int fetch_populated_submodules(const struct argv_array *options,
 		goto out;
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	argv_array_push(&spf.args, "fetch");
 	for (i = 0; i < options->argc; i++)
@@ -801,7 +801,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 	cp.out = -1;
 	cp.dir = path;
 	if (start_command(&cp))
-		die("Could not run 'git status --porcelain' in submodule %s", path);
+		die(_("Could not run 'git status --porcelain' in submodule %s"), path);
 
 	len = strbuf_read(&buf, cp.out, 1024);
 	line = buf.buf;
@@ -826,7 +826,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 	close(cp.out);
 
 	if (finish_command(&cp))
-		die("'git status --porcelain' failed in submodule %s", path);
+		die(_("'git status --porcelain' failed in submodule %s"), path);
 
 	strbuf_release(&buf);
 	return dirty_submodule;
@@ -895,7 +895,7 @@ int ok_to_remove_submodule(const char *path)
 	cp.out = -1;
 	cp.dir = path;
 	if (start_command(&cp))
-		die("Could not run 'git status --porcelain -uall --ignore-submodules=none' in submodule %s", path);
+		die(_("Could not run 'git status --porcelain -uall --ignore-submodules=none' in submodule %s"), path);
 
 	len = strbuf_read(&buf, cp.out, 1024);
 	if (len > 2)
@@ -903,7 +903,7 @@ int ok_to_remove_submodule(const char *path)
 	close(cp.out);
 
 	if (finish_command(&cp))
-		die("'git status --porcelain -uall --ignore-submodules=none' failed in submodule %s", path);
+		die(_("'git status --porcelain -uall --ignore-submodules=none' failed in submodule %s"), path);
 
 	strbuf_release(&buf);
 	return ok_to_remove;
@@ -935,7 +935,7 @@ static int find_first_merges(struct object_array *result, const char *path,
 
 	/* save all revisions from the above list that contain b */
 	if (prepare_revision_walk(&revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(&revs)) != NULL) {
 		struct object *o = &(commit->object);
 		if (in_merge_bases(b, commit))
@@ -978,7 +978,7 @@ static void print_commit(struct commit *commit)
 }
 
 #define MERGE_WARNING(path, msg) \
-	warning("Failed to merge submodule %s (%s)", path, msg);
+	warning(_("Failed to merge submodule %s (%s)"), path, msg);
 
 int merge_submodule(unsigned char result[20], const char *path,
 		    const unsigned char base[20], const unsigned char a[20],
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 19/22] trailer.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (17 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 18/22] submodule.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` 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
                   ` (3 subsequent siblings)
  22 siblings, 1 reply; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 trailer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/trailer.c b/trailer.c
index 94b387b..8e48a5c 100644
--- a/trailer.c
+++ b/trailer.c
@@ -234,7 +234,7 @@ static const char *apply_command(const char *command, const char *arg)
 	cp.use_shell = 1;
 
 	if (capture_command(&cp, &buf, 1024)) {
-		error("running trailer command '%s' failed", cmd.buf);
+		error(_("running trailer command '%s' failed"), cmd.buf);
 		strbuf_release(&buf);
 		result = xstrdup("");
 	} else {
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 20/22] transport-helper.c: mark strings for translating
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (18 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 19/22] trailer.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-27  6:42 ` [PATCH 21/22] transport.c: " Nguyễn Thái Ngọc Duy
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Debug printing is kept in English to reduce workload for
translators. Those rare who actually debug this can read English
anyway.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 transport-helper.c | 84 +++++++++++++++++++++++++++---------------------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index b934183..fa5c077 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -46,7 +46,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)
 		fprintf(stderr, "Debug: Remote helper: -> %s", buffer->buf);
 	if (write_in_full(helper->helper->in, buffer->buf, buffer->len)
 		!= buffer->len)
-		die_errno("Full write to remote helper failed");
+		die_errno(_("Full write to remote helper failed"));
 }
 
 static int recvline_fh(FILE *helper, struct strbuf *buffer, const char *name)
@@ -75,7 +75,7 @@ static void write_constant(int fd, const char *str)
 	if (debug)
 		fprintf(stderr, "Debug: Remote helper: -> %s", str);
 	if (write_in_full(fd, str, strlen(str)) != strlen(str))
-		die_errno("Full write to remote helper failed");
+		die_errno(_("Full write to remote helper failed"));
 }
 
 static const char *remove_ext_force(const char *url)
@@ -129,7 +129,7 @@ static struct child_process *get_helper(struct transport *transport)
 
 	code = start_command(helper);
 	if (code < 0 && errno == ENOENT)
-		die("Unable to find remote helper for '%s'", data->name);
+		die(_("Unable to find remote helper for '%s'"), data->name);
 	else if (code != 0)
 		exit(code);
 
@@ -144,7 +144,7 @@ static struct child_process *get_helper(struct transport *transport)
 	 */
 	duped = dup(helper->out);
 	if (duped < 0)
-		die_errno("Can't dup helper output fd");
+		die_errno(_("Can't dup helper output fd"));
 	data->out = xfdopen(duped, "r");
 
 	write_constant(helper->in, "capabilities\n");
@@ -196,8 +196,8 @@ static struct child_process *get_helper(struct transport *transport)
 		} else if (starts_with(capname, "no-private-update")) {
 			data->no_private_update = 1;
 		} else if (mandatory) {
-			die("Unknown mandatory capability %s. This remote "
-			    "helper probably needs newer version of Git.",
+			die(_("Unknown mandatory capability %s. This remote "
+			      "helper probably needs newer version of Git."),
 			    capname);
 		}
 	}
@@ -209,7 +209,7 @@ static struct child_process *get_helper(struct transport *transport)
 			free((char *)refspecs[i]);
 		free(refspecs);
 	} else if (data->import || data->bidi_import || data->export) {
-		warning("This remote helper should implement refspec capability.");
+		warning(_("This remote helper should implement refspec capability."));
 	}
 	strbuf_release(&buf);
 	if (debug)
@@ -302,7 +302,7 @@ static int set_helper_option(struct transport *transport,
 	} else if (!strcmp(buf.buf, "unsupported"))
 		ret = 1;
 	else {
-		warning("%s unexpectedly said: '%s'", data->name, buf.buf);
+		warning(_("%s unexpectedly said: '%s'"), data->name, buf.buf);
 		ret = 1;
 	}
 	strbuf_release(&buf);
@@ -319,7 +319,7 @@ static void standard_options(struct transport *t)
 
 	n = snprintf(buf, sizeof(buf), "%d", v + 1);
 	if (n >= sizeof(buf))
-		die("impossibly large verbosity value");
+		die(_("impossibly large verbosity value"));
 	set_helper_option(t, "verbosity", buf);
 
 	switch (t->family) {
@@ -376,7 +376,7 @@ static int fetch_with_fetch(struct transport *transport,
 		if (starts_with(buf.buf, "lock ")) {
 			const char *name = buf.buf + 5;
 			if (transport->pack_lockfile)
-				warning("%s also locked %s", data->name, name);
+				warning(_("%s also locked %s"), data->name, name);
 			else
 				transport->pack_lockfile = xstrdup(name);
 		}
@@ -387,7 +387,7 @@ static int fetch_with_fetch(struct transport *transport,
 		else if (!buf.len)
 			break;
 		else
-			warning("%s unexpectedly said: '%s'", data->name, buf.buf);
+			warning(_("%s unexpectedly said: '%s'"), data->name, buf.buf);
 	}
 	strbuf_release(&buf);
 	return 0;
@@ -454,7 +454,7 @@ static int fetch_with_import(struct transport *transport,
 	get_helper(transport);
 
 	if (get_importer(transport, &fastimport))
-		die("Couldn't run fast-import");
+		die(_("Couldn't run fast-import"));
 
 	for (i = 0; i < nr_heads; i++) {
 		posn = to_fetch[i];
@@ -477,7 +477,7 @@ static int fetch_with_import(struct transport *transport,
 	 */
 
 	if (finish_command(&fastimport))
-		die("Error while running fast-import");
+		die(_("Error while running fast-import"));
 
 	/*
 	 * The fast-import stream of a remote helper that advertises
@@ -533,7 +533,7 @@ static int process_connect_service(struct transport *transport,
 	 */
 	duped = dup(helper->out);
 	if (duped < 0)
-		die_errno("Can't dup helper output fd");
+		die_errno(_("Can't dup helper output fd"));
 	input = xfdopen(duped, "r");
 	setvbuf(input, NULL, _IONBF, 0);
 
@@ -544,9 +544,9 @@ static int process_connect_service(struct transport *transport,
 	if (strcmp(name, exec)) {
 		r = set_helper_option(transport, "servpath", exec);
 		if (r > 0)
-			warning("Setting remote service path not supported by protocol.");
+			warning(_("Setting remote service path not supported by protocol."));
 		else if (r < 0)
-			warning("Invalid remote service path.");
+			warning(_("Invalid remote service path."));
 	}
 
 	if (data->connect)
@@ -569,8 +569,7 @@ static int process_connect_service(struct transport *transport,
 			fprintf(stderr, "Debug: Falling back to dumb "
 				"transport.\n");
 	} else
-		die("Unknown response to connect: %s",
-			cmdbuf.buf);
+		die(_("Unknown response to connect: %s"), cmdbuf.buf);
 
 exit:
 	fclose(input);
@@ -601,10 +600,10 @@ static int connect_helper(struct transport *transport, const char *name,
 	/* Get_helper so connect is inited. */
 	get_helper(transport);
 	if (!data->connect)
-		die("Operation not supported by protocol.");
+		die(_("Operation not supported by protocol."));
 
 	if (!process_connect_service(transport, name, exec))
-		die("Can't connect to subservice %s.", name);
+		die(_("Can't connect to subservice %s."), name);
 
 	fd[0] = data->helper->out;
 	fd[1] = data->helper->in;
@@ -663,7 +662,7 @@ static int push_update_ref_status(struct strbuf *buf,
 		status = REF_STATUS_REMOTE_REJECT;
 		refname = buf->buf + 6;
 	} else
-		die("expected ok/error, helper said '%s'", buf->buf);
+		die(_("expected ok/error, helper said '%s'"), buf->buf);
 
 	msg = strchr(refname, ' ');
 	if (msg) {
@@ -724,7 +723,7 @@ static int push_update_ref_status(struct strbuf *buf,
 	if (!*ref)
 		*ref = find_ref_by_name(remote_refs, refname);
 	if (!*ref) {
-		warning("helper reported unexpected status of %s", refname);
+		warning(_("helper reported unexpected status of %s"), refname);
 		return 1;
 	}
 
@@ -784,13 +783,13 @@ static void set_common_push_options(struct transport *transport,
 {
 	if (flags & TRANSPORT_PUSH_DRY_RUN) {
 		if (set_helper_option(transport, "dry-run", "true") != 0)
-			die("helper %s does not support dry-run", name);
+			die(_("helper %s does not support dry-run"), name);
 	} else if (flags & TRANSPORT_PUSH_CERT_ALWAYS) {
 		if (set_helper_option(transport, TRANS_OPT_PUSH_CERT, "true") != 0)
-			die("helper %s does not support --signed", name);
+			die(_("helper %s does not support --signed"), name);
 	} else if (flags & TRANSPORT_PUSH_CERT_IF_ASKED) {
 		if (set_helper_option(transport, TRANS_OPT_PUSH_CERT, "if-asked") != 0)
-			die("helper %s does not support --signed=if-asked", name);
+			die(_("helper %s does not support --signed=if-asked"), name);
 	}
 }
 
@@ -880,12 +879,12 @@ static int push_refs_with_export(struct transport *transport,
 	struct strbuf buf = STRBUF_INIT;
 
 	if (!data->refspecs)
-		die("remote-helper doesn't support push; refspec needed");
+		die(_("remote-helper doesn't support push; refspec needed"));
 
 	set_common_push_options(transport, data->name, flags);
 	if (flags & TRANSPORT_PUSH_FORCE) {
 		if (set_helper_option(transport, "force", "true") != 0)
-			warning("helper %s does not support 'force'", data->name);
+			warning(_("helper %s does not support 'force'"), data->name);
 	}
 
 	helper = get_helper(transport);
@@ -932,12 +931,12 @@ static int push_refs_with_export(struct transport *transport,
 	}
 
 	if (get_exporter(transport, &exporter, &revlist_args))
-		die("Couldn't run fast-export");
+		die(_("Couldn't run fast-export"));
 
 	string_list_clear(&revlist_args, 1);
 
 	if (finish_command(&exporter))
-		die("Error while running fast-export");
+		die(_("Error while running fast-export"));
 	if (push_update_refs_status(data, remote_refs, flags))
 		return 1;
 
@@ -961,8 +960,9 @@ static int push_refs(struct transport *transport,
 	}
 
 	if (!remote_refs) {
-		fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
-			"Perhaps you should specify a branch such as 'master'.\n");
+		fprintf_ln(stderr,
+			   _("No refs in common and none specified; doing nothing.\n"
+			     "Perhaps you should specify a branch such as 'master'."));
 		return 0;
 	}
 
@@ -1023,7 +1023,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
 
 		eov = strchr(buf.buf, ' ');
 		if (!eov)
-			die("Malformed response in ref list: %s", buf.buf);
+			die(_("Malformed response in ref list: %s"), buf.buf);
 		eon = strchr(eov + 1, ' ');
 		*eov = '\0';
 		if (eon)
@@ -1166,7 +1166,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
 	bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
 	if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
 		errno != EINTR) {
-		error("read(%s) failed: %s", t->src_name, strerror(errno));
+		error(_("read(%s) failed: %s"), t->src_name, strerror(errno));
 		return -1;
 	} else if (bytes == 0) {
 		transfer_debug("%s EOF (with %i bytes in buffer)",
@@ -1193,7 +1193,7 @@ static int udt_do_write(struct unidirectional_transfer *t)
 	transfer_debug("%s is writable", t->dest_name);
 	bytes = xwrite(t->dest, t->buf, t->bufuse);
 	if (bytes < 0 && errno != EWOULDBLOCK) {
-		error("write(%s) failed: %s", t->dest_name, strerror(errno));
+		error(_("write(%s) failed: %s"), t->dest_name, strerror(errno));
 		return -1;
 	} else if (bytes > 0) {
 		t->bufuse -= bytes;
@@ -1242,11 +1242,11 @@ static int tloop_join(pthread_t thread, const char *name)
 	void *tret;
 	err = pthread_join(thread, &tret);
 	if (!tret) {
-		error("%s thread failed", name);
+		error(_("%s thread failed"), name);
 		return 1;
 	}
 	if (err) {
-		error("%s thread failed to join: %s", name, strerror(err));
+		error(_("%s thread failed to join: %s"), name, strerror(err));
 		return 1;
 	}
 	return 0;
@@ -1265,11 +1265,11 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)
 	err = pthread_create(&gtp_thread, NULL, udt_copy_task_routine,
 		&s->gtp);
 	if (err)
-		die("Can't start thread for copying data: %s", strerror(err));
+		die(_("Can't start thread for copying data: %s"), strerror(err));
 	err = pthread_create(&ptg_thread, NULL, udt_copy_task_routine,
 		&s->ptg);
 	if (err)
-		die("Can't start thread for copying data: %s", strerror(err));
+		die(_("Can't start thread for copying data: %s"), strerror(err));
 
 	ret |= tloop_join(gtp_thread, "Git to program copy");
 	ret |= tloop_join(ptg_thread, "Program to git copy");
@@ -1306,11 +1306,11 @@ static int tloop_join(pid_t pid, const char *name)
 {
 	int tret;
 	if (waitpid(pid, &tret, 0) < 0) {
-		error("%s process failed to wait: %s", name, strerror(errno));
+		error(_("%s process failed to wait: %s"), name, strerror(errno));
 		return 1;
 	}
 	if (!WIFEXITED(tret) || WEXITSTATUS(tret)) {
-		error("%s process failed", name);
+		error(_("%s process failed"), name);
 		return 1;
 	}
 	return 0;
@@ -1328,7 +1328,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)
 	/* Fork thread #1: git to program. */
 	pid1 = fork();
 	if (pid1 < 0)
-		die_errno("Can't start thread for copying data");
+		die_errno(_("Can't start thread for copying data"));
 	else if (pid1 == 0) {
 		udt_kill_transfer(&s->ptg);
 		exit(udt_copy_task_routine(&s->gtp) ? 0 : 1);
@@ -1337,7 +1337,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)
 	/* Fork thread #2: program to git. */
 	pid2 = fork();
 	if (pid2 < 0)
-		die_errno("Can't start thread for copying data");
+		die_errno(_("Can't start thread for copying data"));
 	else if (pid2 == 0) {
 		udt_kill_transfer(&s->gtp);
 		exit(udt_copy_task_routine(&s->ptg) ? 0 : 1);
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 21/22] transport.c: mark strings for translating
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (19 preceding siblings ...)
  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 ` 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
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

More strings can be translated in print_ref_status() at least, but we
need to deal with utf-8 string length there. Let's stick with a safe
subset for now.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 transport.c | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/transport.c b/transport.c
index ca3cfa4..93be900 100644
--- a/transport.c
+++ b/transport.c
@@ -83,7 +83,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport, int for_pus
 		close(data->fd);
 	data->fd = read_bundle_header(transport->url, &data->header);
 	if (data->fd < 0)
-		die ("Could not read bundle '%s'.", transport->url);
+		die(_("Could not read bundle '%s'."), transport->url);
 	for (i = 0; i < data->header.references.nr; i++) {
 		struct ref_list_entry *e = data->header.references.list + i;
 		struct ref *ref = alloc_ref(e->name);
@@ -148,7 +148,7 @@ static int set_git_option(struct git_transport_options *opts,
 			char *end;
 			opts->depth = strtol(value, &end, 0);
 			if (*end)
-				die("transport: invalid depth option '%s'", value);
+				die(_("transport: invalid depth option '%s'"), value);
 		}
 		return 0;
 	}
@@ -285,7 +285,7 @@ void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int v
 
 	if (!remote_find_tracking(remote, &rs)) {
 		if (verbose)
-			fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
+			fprintf_ln(stderr, _("updating local tracking ref '%s'"), rs.dst);
 		if (ref->deletion) {
 			delete_ref(rs.dst, NULL, 0);
 		} else
@@ -480,8 +480,8 @@ void transport_verify_remote_names(int nr_heads, const char **heads)
 		remote = remote ? (remote + 1) : local;
 		if (check_refname_format(remote,
 				REFNAME_ALLOW_ONELEVEL|REFNAME_REFSPEC_PATTERN))
-			die("remote part of refspec is not a valid name in %s",
-				heads[i]);
+			die(_("remote part of refspec is not a valid name in %s"),
+			    heads[i]);
 	}
 }
 
@@ -626,7 +626,7 @@ int is_transport_allowed(const char *type)
 void transport_check_allowed(const char *type)
 {
 	if (!is_transport_allowed(type))
-		die("transport '%s' not allowed", type);
+		die(_("transport '%s' not allowed"), type);
 }
 
 int transport_restrict_protocols(void)
@@ -665,7 +665,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
 	if (helper) {
 		transport_helper_init(ret, helper);
 	} else if (starts_with(url, "rsync:")) {
-		die("git-over-rsync is no longer supported");
+		die(_("git-over-rsync is no longer supported"));
 	} else if (url_is_local_not_ssh(url) && is_file(url) && is_bundle(url, 1)) {
 		struct bundle_transport_data *data = xcalloc(1, sizeof(*data));
 		transport_check_allowed("file");
@@ -766,19 +766,22 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
 {
 	int i;
 
-	fprintf(stderr, "The following submodule paths contain changes that can\n"
-			"not be found on any remote:\n");
+	fprintf_ln(stderr, _("The following submodule paths contain changes that can\n"
+			     "not be found on any remote:"));
 	for (i = 0; i < needs_pushing->nr; i++)
 		printf("  %s\n", needs_pushing->items[i].string);
-	fprintf(stderr, "\nPlease try\n\n"
-			"	git push --recurse-submodules=on-demand\n\n"
-			"or cd to the path and use\n\n"
-			"	git push\n\n"
-			"to push them to a remote.\n\n");
+	fputc('\n', stderr);
+	fprintf_ln(stderr,
+		   _("Please try\n\n"
+		     "	git push --recurse-submodules=on-demand\n\n"
+		     "or cd to the path and use\n\n"
+		     "	git push\n\n"
+		     "to push them to a remote."));
+	fprintf(stderr, "\n\n");
 
 	string_list_clear(needs_pushing, 0);
 
-	die("Aborting.");
+	die(_("Aborting."));
 }
 
 static int run_pre_push_hook(struct transport *transport,
@@ -853,7 +856,7 @@ int transport_push(struct transport *transport,
 	if (transport->push) {
 		/* Maybe FIXME. But no important transport uses this case. */
 		if (flags & TRANSPORT_PUSH_SET_UPSTREAM)
-			die("This transport does not support using --set-upstream");
+			die(_("This transport does not support using --set-upstream"));
 
 		return transport->push(transport, refspec_nr, refspec, flags);
 	} else if (transport->push_refs) {
@@ -905,7 +908,7 @@ int transport_push(struct transport *transport,
 				if (!is_null_oid(&ref->new_oid) &&
 				    !push_unpushed_submodules(ref->new_oid.hash,
 					    transport->remote->name))
-				    die ("Failed to push all needed submodules!");
+				    die(_("Failed to push all needed submodules!"));
 		}
 
 		if ((flags & (TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND |
@@ -941,7 +944,7 @@ int transport_push(struct transport *transport,
 		if (porcelain && !push_ret)
 			puts("Done");
 		else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
-			fprintf(stderr, "Everything up-to-date\n");
+			fprintf_ln(stderr, _("Everything up-to-date"));
 
 		return ret;
 	}
@@ -1009,7 +1012,7 @@ int transport_connect(struct transport *transport, const char *name,
 	if (transport->connect)
 		return transport->connect(transport, name, exec, fd);
 	else
-		die("Operation not supported by protocol");
+		die(_("Operation not supported by protocol"));
 }
 
 int transport_disconnect(struct transport *transport)
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH 22/22] wrapper.c: mark strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (20 preceding siblings ...)
  2016-02-27  6:42 ` [PATCH 21/22] transport.c: " Nguyễn Thái Ngọc Duy
@ 2016-02-27  6:42 ` Nguyễn Thái Ngọc Duy
  2016-02-27 17:34 ` [PATCH 00/22] Mark more " Junio C Hamano
  22 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-27  6:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 wrapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wrapper.c b/wrapper.c
index 9afc1a0..d2e3068 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -91,10 +91,10 @@ static void *do_xmallocz(size_t size, int gentle)
 	void *ret;
 	if (unsigned_add_overflows(size, 1)) {
 		if (gentle) {
-			error("Data too large to fit into virtual memory space.");
+			error(_("Data too large to fit into virtual memory space."));
 			return NULL;
 		} else
-			die("Data too large to fit into virtual memory space.");
+			die(_("Data too large to fit into virtual memory space."));
 	}
 	ret = do_xmalloc(size + 1, gentle);
 	if (ret)
-- 
2.8.0.rc0.205.g7ec8cf1

^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH 00/22] Mark more strings for translation
  2016-02-27  6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
                   ` (21 preceding siblings ...)
  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 ` Junio C Hamano
  2016-02-27 19:00   ` Junio C Hamano
  2016-02-28  0:43   ` Duy Nguyen
  22 siblings, 2 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-27 17:34 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> On Sat, Feb 27, 2016 at 6:41 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> In previous cycles, I often left many topics in 'next' when tagging
>> this zero-th preview, but eventually merged them before the final.
>> I decided to do things a bit differently for this cycle: a topic,
>> once it hits 'next', will not be rewound and only refined and
>> corrected with incremental updates, so the only effect such a late
>> merge to 'master' before the final is that some topics are not as
>> widely tested on 'master' before the final one is tagged.
>>
>> So this -rc0 is deliberately aggressive in that it includes all
>> topics that have been cooking in 'next' that I think we can fix bugs
>> that might still lurking in them before the final (it merges 25
>> topics since the last batch to 'master').  The topics not merged to
>> this preview, on the other hand, will not be considered for 2.8
>> final, even though I might later succumb to the temptation to pick
>> up ones that are in 'next' as of today ;-)
>
> Beautiful. This allows me to fix up all i18n strings in a single
> series instead of spreading them across many topics in 'next'.

Thanks.  "A new string we added since v2.7.0 that is not marked for
i18n" is a new i18n bug and "a string that used to be marked is not
marked when the code was rewritten since v2.7.0" is an i18n
regression, and we would want to "fix" both post -rc0 period.  The
patches that touch new strings added since 1.7.x are exactly that ;-)

We'd still want the fixes to apply on top of relevant topics if we
could, as the fix to the topic itself (with or without i18n fixes),
when we discover that it has a huge flaw not desirable in v2.8.0,
might be to revert the whole thing, though.

> I'm not
> sure if there's enough time for translators before release though.

Also we need to get an Ack from the authors of commits we added in
this cycle that these patches fix i18n bugs they introduced and make
sure there is no "this i18n mark is not appropriate as it is a
plumbing output (or protocol messsage) that should not be
translated" response from them.  It won't be like I apply these
blindly today and ask translators to start working.

> This series marks many strings for translation. It's a result of
> looking for new strings between 1.7.2 and 'master', and sometimes
> looking around touched files some more.
>
> Most of these are wrapping _() around strings, except 01/22 (enable
> gettext) and 20/22 and 21/22, which convert some more strings (they
> have been in my queue for a year)
>
>   [01/22] credential-cache--daemon: enable localized messages
>   [02/22] builtin/blame.c: mark strings for translation
>   [03/22] builtin/checkout.c: mark strings for translation
>   [04/22] builtin/clone.c: mark strings for translation
>   [05/22] builtin/config.c: mark strings for translation
>   [06/22] builtin/config.c: mark strings for translation
>   [07/22] builtin/update-index.c: mark strings for translation
>   [08/22] convert.c: mark strings for translation
>   [09/22] credential-cache--daemon.c: mark strings for translation
>   [10/22] http.c: mark strings for translation
>   [11/22] ident.c: mark strings for translation
>   [12/22] notes.c: mark strings for translation
>   [13/22] ref-filter.c: mark strings for translation
>   [14/22] refs/files-backend.c: mark strings for translation
>   [15/22] remote-curl.c: mark strings for translation
>   [16/22] run-command.c: mark strings for translation
>   [17/22] sha1_file.c: mark strings for translation
>   [18/22] submodule.c: mark strings for translation
>   [19/22] trailer.c: mark strings for translation
>   [20/22] transport-helper.c: mark strings for translating
>   [21/22] transport.c: mark strings for translating
>   [22/22] wrapper.c: mark strings for translation
>
> Total 20 files changed, 385 insertions(+), 372 deletions(-)

Let's queue this and start cooking; I see you never To'ed the guilty
party that introduced i18n bug/regression to each of your patch, but
can you start pinging them to collect Acks?

Thanks.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 00/22] Mark more strings for translation
  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
  1 sibling, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-27 19:00 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Thanks.  "A new string we added since v2.7.0 that is not marked for
> i18n" is a new i18n bug and "a string that used to be marked is not
> marked when the code was rewritten since v2.7.0" is an i18n
> regression, and we would want to "fix" both post -rc0 period.  The
> patches that touch new strings added since 1.7.x are exactly that ;-)

Oops, I meant 2.7.x here, not 1.7.x.

>> This series marks many strings for translation. It's a result of
>> looking for new strings between 1.7.2 and 'master', and sometimes
>> looking around touched files some more.

And I hope you meant 2.7.2 here, too.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 00/22] Mark more strings for translation
  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
  1 sibling, 0 replies; 47+ messages in thread
From: Duy Nguyen @ 2016-02-28  0:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Sun, Feb 28, 2016 at 12:34 AM, Junio C Hamano <gitster@pobox.com> wrote:
> We'd still want the fixes to apply on top of relevant topics if we
> could, as the fix to the topic itself (with or without i18n fixes),
> when we discover that it has a huge flaw not desirable in v2.8.0,
> might be to revert the whole thing, though.
>
>> I'm not
>> sure if there's enough time for translators before release though.
>
> Also we need to get an Ack from the authors of commits we added in
> this cycle that these patches fix i18n bugs they introduced and make
> sure there is no "this i18n mark is not appropriate as it is a
> plumbing output (or protocol messsage) that should not be
> translated" response from them.  It won't be like I apply these
> blindly today and ask translators to start working.

Urgh.. if there are only a handful of topics (like in 'pu' and 'next'
now), I could go identify author/series manually. But there are 118
topics since 2.7.2 and my series changes about 300 strings. Hold on
tight, let me write something that blames based on diff...
-- 
Duy

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 02/22] builtin/blame.c: mark strings for translation
  2016-02-27  6:41 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
@ 2016-02-28 18:57   ` Junio C Hamano
  2016-02-29  0:33     ` Duy Nguyen
  0 siblings, 1 reply; 47+ messages in thread
From: Junio C Hamano @ 2016-02-28 18:57 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  builtin/blame.c | 58 ++++++++++++++++++++++++++++-----------------------------
>  1 file changed, 29 insertions(+), 29 deletions(-)

I think most of the strings we see here are not new ones introduced
in this cycle.  I doubt it is a good idea to disturb the codebase,
distract ourselves and adding last-minute workload to translators
with this during the pre-release period.



>
> 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)

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 03/22] builtin/checkout.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-28 19:00 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  builtin/checkout.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The command otherwise has been i18n'ed and it is clear that the
patch that added this string should have done the i18n marking shown
here from the beginning.  Let's take this.

>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index cfa66e2..efcbd8f 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -662,7 +662,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
>  		}
>  	} else if (new->path) {	/* Switch branches. */
>  		if (create_symref("HEAD", new->path, msg.buf) < 0)
> -			die("unable to update HEAD");
> +			die(_("unable to update HEAD"));
>  		if (!opts->quiet) {
>  			if (old->path && !strcmp(new->path, old->path)) {
>  				if (opts->new_branch_force)

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 04/22] builtin/clone.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-28 19:05 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  builtin/clone.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

The command otherwise has been i18n'ed and it is clear that the
patches that added these strings should have done the i18n marking
shown here from the beginning.  Let's take this.

>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 9ac6c01..6616392 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -236,8 +236,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
>  	strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git");
>  
>  	if (!len || (len == 1 && *start == '/'))
> -	    die("No directory name could be guessed.\n"
> -		"Please specify a directory on the command line");
> +		die(_("No directory name could be guessed.\n"
> +		      "Please specify a directory on the command line"));
>  
>  	if (is_bare)
>  		dir = xstrfmt("%.*s.git", (int)len, start);
> @@ -644,7 +644,7 @@ static void update_remote_refs(const struct ref *refs,
>  		if (create_symref(head_ref.buf,
>  				  remote_head_points_at->peer_ref->name,
>  				  msg) < 0)
> -			die("unable to update %s", head_ref.buf);
> +			die(_("unable to update %s"), head_ref.buf);
>  		strbuf_release(&head_ref);
>  	}
>  }
> @@ -656,7 +656,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
>  	if (our && skip_prefix(our->name, "refs/heads/", &head)) {
>  		/* Local default branch link */
>  		if (create_symref("HEAD", our->name, NULL) < 0)
> -			die("unable to update HEAD");
> +			die(_("unable to update HEAD"));
>  		if (!option_bare) {
>  			update_ref(msg, "HEAD", our->old_oid.hash, NULL, 0,
>  				   UPDATE_REFS_DIE_ON_ERR);
> @@ -750,7 +750,7 @@ static void write_config(struct string_list *config)
>  	for (i = 0; i < config->nr; i++) {
>  		if (git_config_parse_parameter(config->items[i].string,
>  					       write_one_config, NULL) < 0)
> -			die("unable to write parameters to config file");
> +			die(_("unable to write parameters to config file"));
>  	}
>  }

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 02/22] builtin/blame.c: mark strings for translation
  2016-02-28 18:57   ` Junio C Hamano
@ 2016-02-29  0:33     ` Duy Nguyen
  2016-02-29 18:22       ` Junio C Hamano
  0 siblings, 1 reply; 47+ messages in thread
From: Duy Nguyen @ 2016-02-29  0:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Mon, Feb 29, 2016 at 1:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>>  builtin/blame.c | 58 ++++++++++++++++++++++++++++-----------------------------
>>  1 file changed, 29 insertions(+), 29 deletions(-)
>
> I think most of the strings we see here are not new ones introduced
> in this cycle.  I doubt it is a good idea to disturb the codebase,
> distract ourselves and adding last-minute workload to translators
> with this during the pre-release period.

Yes, it's ok to consider this series a new topic, to be graduated after 2.8.0.
-- 
Duy

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 02/22] builtin/blame.c: mark strings for translation
  2016-02-29  0:33     ` Duy Nguyen
@ 2016-02-29 18:22       ` Junio C Hamano
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:22 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Git Mailing List

Duy Nguyen <pclouds@gmail.com> writes:

> On Mon, Feb 29, 2016 at 1:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>>
>>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>>> ---
>>>  builtin/blame.c | 58 ++++++++++++++++++++++++++++-----------------------------
>>>  1 file changed, 29 insertions(+), 29 deletions(-)
>>
>> I think most of the strings we see here are not new ones introduced
>> in this cycle.  I doubt it is a good idea to disturb the codebase,
>> distract ourselves and adding last-minute workload to translators
>> with this during the pre-release period.
>
> Yes, it's ok to consider this series a new topic, to be graduated after 2.8.0.

I wasn't talking about the whole topic, but 02/22 did not look
suitable for the pre-release fix.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 05/22] builtin/config.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:25 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Johannes Schindelin

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

This does look like a "new i18n bug" introduced in this cycle, but
given that this program does not have much _() in the first place,
I'm inclined to say we should do the whole thing post 2.8.0 release
for this file, discarding this patch.

>  builtin/config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/config.c b/builtin/config.c
> index ca9f834..98ca43d 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -378,7 +378,7 @@ static int get_colorbool(const char *var, int print)
>  static void check_write(void)
>  {
>  	if (!given_config_source.file && !startup_info->have_repository)
> -		die("not in a git directory");
> +		die(_("not in a git directory"));
>  
>  	if (given_config_source.use_stdin)
>  		die("writing to stdin is not supported");

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 07/22] builtin/update-index.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:27 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Christian Couder

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

This does look like a "new i18n bug" introduced in this cycle, but
given that this program does not have many _()s in the first place,
I'm inclined to say we should do the whole thing post 2.8.0 release
for this file, discarding this patch.

>  builtin/update-index.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/builtin/update-index.c b/builtin/update-index.c
> index 1c94ca5..21e38a8 100644
> --- a/builtin/update-index.c
> +++ b/builtin/update-index.c
> @@ -1127,9 +1127,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>  		break;
>  	case UC_DISABLE:
>  		if (git_config_get_untracked_cache() == 1)
> -			warning("core.untrackedCache is set to true; "
> -				"remove or change it, if you really want to "
> -				"disable the untracked cache");
> +			warning(_("core.untrackedCache is set to true; "
> +				  "remove or change it, if you really want to "
> +				  "disable the untracked cache"));
>  		remove_untracked_cache(&the_index);
>  		report(_("Untracked cache disabled"));
>  		break;
> @@ -1139,9 +1139,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>  	case UC_ENABLE:
>  	case UC_FORCE:
>  		if (git_config_get_untracked_cache() == 0)
> -			warning("core.untrackedCache is set to false; "
> -				"remove or change it, if you really want to "
> -				"enable the untracked cache");
> +			warning(_("core.untrackedCache is set to false; "
> +				  "remove or change it, if you really want to "
> +				  "enable the untracked cache"));
>  		add_untracked_cache(&the_index);
>  		report(_("Untracked cache enabled for '%s'"), get_git_work_tree());
>  		break;
> @@ -1156,7 +1156,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>  			unable_to_lock_die(get_index_file(), lock_error);
>  		}
>  		if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
> -			die("Unable to write new index file");
> +			die(_("Unable to write new index file"));
>  	}
>  
>  	rollback_lock_file(lock_file);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 08/22] convert.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:29 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most of) these look old ones.  I'm inclined to say
we should do the whole thing post 2.8.0 release for this file.

>  convert.c | 30 +++++++++++++++++-------------
>  1 file changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/convert.c b/convert.c
> index f524b8d..59d03b0 100644
> --- a/convert.c
> +++ b/convert.c
> @@ -199,9 +199,11 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
>  		 */
>  		if (stats->crlf) {
>  			if (checksafe == SAFE_CRLF_WARN)
> -				warning("CRLF will be replaced by LF in %s.\nThe file will have its original line endings in your working directory.", path);
> +				warning(_("CRLF will be replaced by LF in %s.\n"
> +					  "The file will have its original line "
> +					  "endings in your working directory."), path);
>  			else /* i.e. SAFE_CRLF_FAIL */
> -				die("CRLF would be replaced by LF in %s.", path);
> +				die(_("CRLF would be replaced by LF in %s."), path);
>  		}
>  	} else if (output_eol(crlf_action) == EOL_CRLF) {
>  		/*
> @@ -210,9 +212,11 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
>  		 */
>  		if (stats->lonelf) {
>  			if (checksafe == SAFE_CRLF_WARN)
> -				warning("LF will be replaced by CRLF in %s.\nThe file will have its original line endings in your working directory.", path);
> +				warning(_("LF will be replaced by CRLF in %s.\n"
> +					  "The file will have its original line "
> +					  "endings in your working directory."), path);
>  			else /* i.e. SAFE_CRLF_FAIL */
> -				die("LF would be replaced by CRLF in %s", path);
> +				die(_("LF would be replaced by CRLF in %s"), path);
>  		}
>  	}
>  }
> @@ -397,7 +401,7 @@ static int filter_buffer_or_fd(int in, int out, void *data)
>  	child_process.out = out;
>  
>  	if (start_command(&child_process))
> -		return error("cannot fork to run external filter %s", params->cmd);
> +		return error(_("cannot fork to run external filter %s"), params->cmd);
>  
>  	sigchain_push(SIGPIPE, SIG_IGN);
>  
> @@ -415,13 +419,13 @@ static int filter_buffer_or_fd(int in, int out, void *data)
>  	if (close(child_process.in))
>  		write_err = 1;
>  	if (write_err)
> -		error("cannot feed the input to external filter %s", params->cmd);
> +		error(_("cannot feed the input to external filter %s"), params->cmd);
>  
>  	sigchain_pop(SIGPIPE);
>  
>  	status = finish_command(&child_process);
>  	if (status)
> -		error("external filter %s failed %d", params->cmd, status);
> +		error(_("external filter %s failed %d"), params->cmd, status);
>  
>  	strbuf_release(&cmd);
>  	return (write_err || status);
> @@ -462,15 +466,15 @@ static int apply_filter(const char *path, const char *src, size_t len, int fd,
>  		return 0;	/* error was already reported */
>  
>  	if (strbuf_read(&nbuf, async.out, len) < 0) {
> -		error("read from external filter %s failed", cmd);
> +		error(_("read from external filter %s failed"), cmd);
>  		ret = 0;
>  	}
>  	if (close(async.out)) {
> -		error("read from external filter %s failed", cmd);
> +		error(_("read from external filter %s failed"), cmd);
>  		ret = 0;
>  	}
>  	if (finish_async(&async)) {
> -		error("external filter %s failed", cmd);
> +		error(_("external filter %s failed"), cmd);
>  		ret = 0;
>  	}
>  
> @@ -868,7 +872,7 @@ int convert_to_git(const char *path, const char *src, size_t len,
>  
>  	ret |= apply_filter(path, src, len, -1, dst, filter);
>  	if (!ret && required)
> -		die("%s: clean filter '%s' failed", path, ca.drv->name);
> +		die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
>  
>  	if (ret && dst) {
>  		src = dst->buf;
> @@ -892,7 +896,7 @@ void convert_to_git_filter_fd(const char *path, int fd, struct strbuf *dst,
>  	assert(ca.drv->clean);
>  
>  	if (!apply_filter(path, NULL, 0, fd, dst, ca.drv->clean))
> -		die("%s: clean filter '%s' failed", path, ca.drv->name);
> +		die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
>  
>  	crlf_to_git(path, dst->buf, dst->len, dst, ca.crlf_action, checksafe);
>  	ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
> @@ -932,7 +936,7 @@ static int convert_to_working_tree_internal(const char *path, const char *src,
>  
>  	ret_filter = apply_filter(path, src, len, -1, dst, filter);
>  	if (!ret_filter && required)
> -		die("%s: smudge filter %s failed", path, ca.drv->name);
> +		die(_("%s: smudge filter %s failed"), path, ca.drv->name);
>  
>  	return ret | ret_filter;
>  }

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 09/22] credential-cache--daemon.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:30 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Jeff King

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most of) these look old ones.  I'm inclined to say
we should do the whole thing post 2.8.0 release for this file.


>  credential-cache--daemon.c | 34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c
> index 63ca7c8..ab33355 100644
> --- a/credential-cache--daemon.c
> +++ b/credential-cache--daemon.c
> @@ -98,12 +98,12 @@ static int read_request(FILE *fh, struct credential *c,
>  
>  	strbuf_getline_lf(&item, fh);
>  	if (!skip_prefix(item.buf, "action=", &p))
> -		return error("client sent bogus action line: %s", item.buf);
> +		return error(_("client sent bogus action line: %s"), item.buf);
>  	strbuf_addstr(action, p);
>  
>  	strbuf_getline_lf(&item, fh);
>  	if (!skip_prefix(item.buf, "timeout=", &p))
> -		return error("client sent bogus timeout line: %s", item.buf);
> +		return error(_("client sent bogus timeout line: %s"), item.buf);
>  	*timeout = atoi(p);
>  
>  	if (credential_read(c, fh) < 0)
> @@ -132,16 +132,16 @@ static void serve_one_client(FILE *in, FILE *out)
>  		remove_credential(&c);
>  	else if (!strcmp(action.buf, "store")) {
>  		if (timeout < 0)
> -			warning("cache client didn't specify a timeout");
> +			warning(_("cache client didn't specify a timeout"));
>  		else if (!c.username || !c.password)
> -			warning("cache client gave us a partial credential");
> +			warning(_("cache client gave us a partial credential"));
>  		else {
>  			remove_credential(&c);
>  			cache_credential(&c, timeout);
>  		}
>  	}
>  	else
> -		warning("cache client sent unknown action: %s", action.buf);
> +		warning(_("cache client sent unknown action: %s"), action.buf);
>  
>  	credential_clear(&c);
>  	strbuf_release(&action);
> @@ -160,7 +160,7 @@ static int serve_cache_loop(int fd)
>  	pfd.events = POLLIN;
>  	if (poll(&pfd, 1, 1000 * wakeup) < 0) {
>  		if (errno != EINTR)
> -			die_errno("poll failed");
> +			die_errno(_("poll failed"));
>  		return 1;
>  	}
>  
> @@ -170,12 +170,12 @@ static int serve_cache_loop(int fd)
>  
>  		client = accept(fd, NULL, NULL);
>  		if (client < 0) {
> -			warning("accept failed: %s", strerror(errno));
> +			warning(_("accept failed: %s"), strerror(errno));
>  			return 1;
>  		}
>  		client2 = dup(client);
>  		if (client2 < 0) {
> -			warning("dup failed: %s", strerror(errno));
> +			warning(_("dup failed: %s"), strerror(errno));
>  			close(client);
>  			return 1;
>  		}
> @@ -195,13 +195,13 @@ static void serve_cache(const char *socket_path, int debug)
>  
>  	fd = unix_stream_listen(socket_path);
>  	if (fd < 0)
> -		die_errno("unable to bind to '%s'", socket_path);
> +		die_errno(_("unable to bind to '%s'"), socket_path);
>  
>  	printf("ok\n");
>  	fclose(stdout);
>  	if (!debug) {
>  		if (!freopen("/dev/null", "w", stderr))
> -			die_errno("unable to point stderr to /dev/null");
> +			die_errno(_("unable to point stderr to /dev/null"));
>  	}
>  
>  	while (serve_cache_loop(fd))
> @@ -211,10 +211,10 @@ static void serve_cache(const char *socket_path, int debug)
>  }
>  
>  static const char permissions_advice[] =
> -"The permissions on your socket directory are too loose; other\n"
> +N_("The permissions on your socket directory are too loose; other\n"
>  "users may be able to read your cached credentials. Consider running:\n"
>  "\n"
> -"	chmod 0700 %s";
> +"	chmod 0700 %s");
>  static void init_socket_directory(const char *path)
>  {
>  	struct stat st;
> @@ -223,7 +223,7 @@ static void init_socket_directory(const char *path)
>  
>  	if (!stat(dir, &st)) {
>  		if (st.st_mode & 077)
> -			die(permissions_advice, dir);
> +			die(_(permissions_advice), dir);
>  	} else {
>  		/*
>  		 * We must be sure to create the directory with the correct mode,
> @@ -232,9 +232,9 @@ static void init_socket_directory(const char *path)
>  		 * our protected socket.
>  		 */
>  		if (safe_create_leading_directories_const(dir) < 0)
> -			die_errno("unable to create directories for '%s'", dir);
> +			die_errno(_("unable to create directories for '%s'"), dir);
>  		if (mkdir(dir, 0700) < 0)
> -			die_errno("unable to mkdir '%s'", dir);
> +			die_errno(_("unable to mkdir '%s'"), dir);
>  	}
>  
>  	if (chdir(dir))
> @@ -253,7 +253,7 @@ int main(int argc, const char **argv)
>  	const char *socket_path;
>  	int ignore_sighup = 0;
>  	static const char *usage[] = {
> -		"git-credential-cache--daemon [opts] <socket_path>",
> +		N_("git-credential-cache--daemon [opts] <socket_path>"),
>  		NULL
>  	};
>  	int debug = 0;
> @@ -274,7 +274,7 @@ int main(int argc, const char **argv)
>  		usage_with_options(usage, options);
>  
>  	if (!is_absolute_path(socket_path))
> -		die("socket directory must be an absolute path");
> +		die(_("socket directory must be an absolute path"));
>  
>  	init_socket_directory(socket_path);
>  	register_tempfile(&socket_file, socket_path);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 10/22] http.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:31 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most of) these look old ones.  I'm inclined to say
we should do the whole thing post 2.8.0 release for this file.

>  http.c | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/http.c b/http.c
> index 1d5e3bb..d56cb52 100644
> --- a/http.c
> +++ b/http.c
> @@ -404,7 +404,7 @@ static void init_curl_proxy_auth(CURL *result)
>  			}
>  		}
>  		if (i == ARRAY_SIZE(proxy_authmethods)) {
> -			warning("unsupported proxy authentication method %s: using anyauth",
> +			warning(_("unsupported proxy authentication method %s: using anyauth"),
>  					http_proxy_authmethod);
>  			curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
>  		}
> @@ -445,7 +445,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
>  
>  	rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
>  	if (rc < 0)
> -		warning("unable to set SO_KEEPALIVE on socket %s",
> +		warning(_("unable to set SO_KEEPALIVE on socket %s"),
>  			strerror(errno));
>  
>  	return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
> @@ -469,7 +469,7 @@ static CURL *get_curl_handle(void)
>  	long allowed_protocols = 0;
>  
>  	if (!result)
> -		die("curl_easy_init failed");
> +		die(_("curl_easy_init failed"));
>  
>  	if (!curl_ssl_verify) {
>  		curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
> @@ -503,7 +503,7 @@ static CURL *get_curl_handle(void)
>  			}
>  		}
>  		if (i == ARRAY_SIZE(sslversions))
> -			warning("unsupported ssl version %s: using default",
> +			warning(_("unsupported ssl version %s: using default"),
>  				ssl_version);
>  	}
>  
> @@ -558,8 +558,8 @@ static CURL *get_curl_handle(void)
>  	curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS, allowed_protocols);
>  #else
>  	if (transport_restrict_protocols())
> -		warning("protocol restrictions not applied to curl redirects because\n"
> -			"your curl version is too old (>= 7.19.4)");
> +		warning(_("protocol restrictions not applied to curl redirects because\n"
> +			  "your curl version is too old (>= 7.19.4)"));
>  #endif
>  
>  	if (getenv("GIT_CURL_VERBOSE"))
> @@ -659,7 +659,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
>  	free(normalized_url);
>  
>  	if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK)
> -		die("curl_global_init failed");
> +		die(_("curl_global_init failed"));
>  
>  	http_proactive_auth = proactive_auth;
>  
> @@ -681,7 +681,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
>  
>  	curlm = curl_multi_init();
>  	if (!curlm)
> -		die("curl_multi_init failed");
> +		die(_("curl_multi_init failed"));
>  #endif
>  
>  	if (getenv("GIT_SSL_NO_VERIFY"))
> @@ -1544,7 +1544,7 @@ static int http_get_file(const char *url, const char *filename,
>  	strbuf_addf(&tmpfile, "%s.temp", filename);
>  	result = fopen(tmpfile.buf, "a");
>  	if (!result) {
> -		error("Unable to open local file %s", tmpfile.buf);
> +		error(_("Unable to open local file %s"), tmpfile.buf);
>  		ret = HTTP_ERROR;
>  		goto cleanup;
>  	}
> @@ -1601,7 +1601,7 @@ static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
>  	tmp = strbuf_detach(&buf, NULL);
>  
>  	if (http_get_file(url, tmp, NULL) != HTTP_OK) {
> -		error("Unable to get pack index %s", url);
> +		error(_("Unable to get pack index %s"), url);
>  		free(tmp);
>  		tmp = NULL;
>  	}
> @@ -1778,7 +1778,7 @@ struct http_pack_request *new_http_pack_request(
>  		sha1_pack_name(target->sha1));
>  	preq->packfile = fopen(preq->tmpfile, "a");
>  	if (!preq->packfile) {
> -		error("Unable to open local file %s for pack",
> +		error(_("Unable to open local file %s for pack"),
>  		      preq->tmpfile);
>  		goto abort;
>  	}
> @@ -1866,7 +1866,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
>  	unlink_or_warn(freq->tmpfile);
>  
>  	if (freq->localfile != -1)
> -		error("fd leakage in start: %d", freq->localfile);
> +		error(_("fd leakage in start: %d"), freq->localfile);
>  	freq->localfile = open(freq->tmpfile,
>  			       O_WRONLY | O_CREAT | O_EXCL, 0666);
>  	/*
> @@ -1885,7 +1885,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
>  	}
>  
>  	if (freq->localfile < 0) {
> -		error("Couldn't create temporary file %s: %s",
> +		error(_("Couldn't create temporary file %s: %s"),
>  		      freq->tmpfile, strerror(errno));
>  		goto abort;
>  	}
> @@ -1931,7 +1931,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
>  			prev_posn = 0;
>  			lseek(freq->localfile, 0, SEEK_SET);
>  			if (ftruncate(freq->localfile, 0) < 0) {
> -				error("Couldn't truncate temporary file %s: %s",
> +				error(_("Couldn't truncate temporary file %s: %s"),
>  					  freq->tmpfile, strerror(errno));
>  				goto abort;
>  			}
> @@ -1985,7 +1985,7 @@ int finish_http_object_request(struct http_object_request *freq)
>  	process_http_object_request(freq);
>  
>  	if (freq->http_code == 416) {
> -		warning("requested range invalid; we may already have all the data.");
> +		warning(_("requested range invalid; we may already have all the data."));
>  	} else if (freq->curl_result != CURLE_OK) {
>  		if (stat(freq->tmpfile, &st) == 0)
>  			if (st.st_size == 0)

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 11/22] ident.c: mark strings for translation
  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
  0 siblings, 1 reply; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:34 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Jeff King

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most of) these look old ones; even the ones blamed
to 59f92959 (fmt_ident: refactor strictness checks, 2016-02-04) had
original in the same file without _().

I'm inclined to say we should do the whole thing post 2.8.0 release
for this file.

>  ident.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/ident.c b/ident.c
> index 6e12582..367a5dc 100644
> --- a/ident.c
> +++ b/ident.c
> @@ -75,13 +75,13 @@ static int add_mailname_host(struct strbuf *buf)
>  	mailname = fopen("/etc/mailname", "r");
>  	if (!mailname) {
>  		if (errno != ENOENT)
> -			warning("cannot open /etc/mailname: %s",
> +			warning(_("cannot open /etc/mailname: %s"),
>  				strerror(errno));
>  		return -1;
>  	}
>  	if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
>  		if (ferror(mailname))
> -			warning("cannot read /etc/mailname: %s",
> +			warning(_("cannot read /etc/mailname: %s"),
>  				strerror(errno));
>  		strbuf_release(&mailnamebuf);
>  		fclose(mailname);
> @@ -125,7 +125,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
>  	char buf[1024];
>  
>  	if (gethostname(buf, sizeof(buf))) {
> -		warning("cannot get host name: %s", strerror(errno));
> +		warning(_("cannot get host name: %s"), strerror(errno));
>  		strbuf_addstr(out, "(none)");
>  		*is_bogus = 1;
>  		return;
> @@ -355,18 +355,18 @@ const char *fmt_ident(const char *name, const char *email,
>  			using_default = 1;
>  			if (strict && default_name_is_bogus) {
>  				fputs(env_hint, stderr);
> -				die("unable to auto-detect name (got '%s')", name);
> +				die(_("unable to auto-detect name (got '%s')"), name);
>  			}
>  			if (strict && ident_use_config_only
>  			    && !(ident_config_given & IDENT_NAME_GIVEN))
> -				die("user.useConfigOnly set but no name given");
> +				die(_("user.useConfigOnly set but no name given"));
>  		}
>  		if (!*name) {
>  			struct passwd *pw;
>  			if (strict) {
>  				if (using_default)
>  					fputs(env_hint, stderr);
> -				die("empty ident name (for <%s>) not allowed", email);
> +				die(_("empty ident name (for <%s>) not allowed"), email);
>  			}
>  			pw = xgetpwuid_self(NULL);
>  			name = pw->pw_name;
> @@ -377,11 +377,11 @@ const char *fmt_ident(const char *name, const char *email,
>  		email = ident_default_email();
>  		if (strict && default_email_is_bogus) {
>  			fputs(env_hint, stderr);
> -			die("unable to auto-detect email address (got '%s')", email);
> +			die(_("unable to auto-detect email address (got '%s')"), email);
>  		}
>  		if (strict && ident_use_config_only
>  		    && !(ident_config_given & IDENT_MAIL_GIVEN))
> -			die("user.useConfigOnly set but no mail given");
> +			die(_("user.useConfigOnly set but no mail given"));
>  	}
>  
>  	strbuf_reset(&ident);
> @@ -396,7 +396,7 @@ const char *fmt_ident(const char *name, const char *email,
>  		strbuf_addch(&ident, ' ');
>  		if (date_str && date_str[0]) {
>  			if (parse_date(date_str, &ident) < 0)
> -				die("invalid date format: %s", date_str);
> +				die(_("invalid date format: %s"), date_str);
>  		}
>  		else
>  			strbuf_addstr(&ident, ident_default_date());

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 12/22] notes.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:36 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most of) these look old ones.  I'm inclined to say
we should do the whole thing post 2.8.0 release for this file.

>  notes.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/notes.c b/notes.c
> index 88cf474..0f03f77 100644
> --- a/notes.c
> +++ b/notes.c
> @@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
>  
>  	buf = fill_tree_descriptor(&desc, subtree->val_sha1);
>  	if (!buf)
> -		die("Could not read %s for notes-index",
> +		die(_("Could not read %s for notes-index"),
>  		     sha1_to_hex(subtree->val_sha1));
>  
>  	prefix_len = subtree->key_sha1[19];
> @@ -455,8 +455,8 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
>  			}
>  			if (note_tree_insert(t, node, n, l, type,
>  					     combine_notes_concatenate))
> -				die("Failed to load %s %s into notes tree "
> -				    "from %s",
> +				die(_("Failed to load %s %s into notes tree "
> +				      "from %s"),
>  				    type == PTR_TYPE_NOTE ? "note" : "subtree",
>  				    sha1_to_hex(l->key_sha1), t->ref);
>  		}
> @@ -942,7 +942,7 @@ void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
>  	} else {
>  		unsigned char sha1[20];
>  		if (get_sha1(glob, sha1))
> -			warning("notes ref %s is invalid", glob);
> +			warning(_("notes ref %s is invalid"), glob);
>  		if (!unsorted_string_list_has_string(list, glob))
>  			string_list_append(list, glob);
>  	}
> @@ -1020,9 +1020,9 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
>  	    get_sha1_treeish(notes_ref, object_sha1))
>  		return;
>  	if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_sha1))
> -		die("Cannot use notes ref %s", notes_ref);
> +		die(_("Cannot use notes ref %s"), notes_ref);
>  	if (get_tree_entry(object_sha1, "", sha1, &mode))
> -		die("Failed to read notes tree referenced by %s (%s)",
> +		die(_("Failed to read notes tree referenced by %s (%s)"),
>  		    notes_ref, sha1_to_hex(object_sha1));
>  
>  	hashclr(root_tree.key_sha1);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 13/22] ref-filter.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:41 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Karthik Nayak

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

About half of this we can find in 2.7.0, but we can see that many
existing messages are already marked.  Let's take this for 2.8.0 (I
am assuming that this covers the whole file, not just relatively new
ones).

>  ref-filter.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/ref-filter.c b/ref-filter.c
> index bb79d6b..bc551a7 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -74,14 +74,14 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
>  static void body_atom_parser(struct used_atom *atom, const char *arg)
>  {
>  	if (arg)
> -		die("%%(body) does not take arguments");
> +		die(_("%%(body) does not take arguments"));
>  	atom->u.contents.option = C_BODY_DEP;
>  }
>  
>  static void subject_atom_parser(struct used_atom *atom, const char *arg)
>  {
>  	if (arg)
> -		die("%%(subject) does not take arguments");
> +		die(_("%%(subject) does not take arguments"));
>  	atom->u.contents.option = C_SUB;
>  }
>  
> @@ -241,7 +241,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
>  	if (*sp == '*' && sp < ep)
>  		sp++; /* deref */
>  	if (ep <= sp)
> -		die("malformed field name: %.*s", (int)(ep-atom), atom);
> +		die(_("malformed field name: %.*s"), (int)(ep-atom), atom);
>  
>  	/* Do we have the atom already used elsewhere? */
>  	for (i = 0; i < used_atom_cnt; i++) {
> @@ -267,7 +267,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
>  	}
>  
>  	if (ARRAY_SIZE(valid_atom) <= i)
> -		die("unknown field name: %.*s", (int)(ep-atom), atom);
> +		die(_("unknown field name: %.*s"), (int)(ep-atom), atom);
>  
>  	/* Add it in, including the deref prefix */
>  	at = used_atom_cnt;
> @@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
>  		int at;
>  
>  		if (!ep)
> -			return error("malformed format string %s", sp);
> +			return error(_("malformed format string %s"), sp);
>  		/* sp points at "%(" and ep points at the closing ")" */
>  		at = parse_ref_filter_atom(sp + 2, ep);
>  		cp = ep + 1;
> @@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
>  	const char *start = refname;
>  
>  	if (nr < 1 || *end != '\0')
> -		die(":strip= requires a positive integer argument");
> +		die(_(":strip= requires a positive integer argument"));
>  
>  	while (remaining) {
>  		switch (*start++) {
>  		case '\0':
> -			die("ref '%s' does not have %ld components to :strip",
> +			die(_("ref '%s' does not have %ld components to :strip"),
>  			    refname, nr);
>  		case '/':
>  			remaining--;
> @@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
>  			else if (skip_prefix(formatp, "strip=", &arg))
>  				refname = strip_ref_components(refname, arg);
>  			else
> -				die("unknown %.*s format %s",
> +				die(_("unknown %.*s format %s"),
>  				    (int)(formatp - name), name, formatp);
>  		}
>  
> @@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
>   need_obj:
>  	buf = get_obj(ref->objectname, &obj, &size, &eaten);
>  	if (!buf)
> -		die("missing object %s for %s",
> +		die(_("missing object %s for %s"),
>  		    sha1_to_hex(ref->objectname), ref->refname);
>  	if (!obj)
> -		die("parse_object_buffer failed on %s for %s",
> +		die(_("parse_object_buffer failed on %s for %s"),
>  		    sha1_to_hex(ref->objectname), ref->refname);
>  
>  	grab_values(ref->value, 0, obj, buf, size);
> @@ -1094,10 +1094,10 @@ static void populate_value(struct ref_array_item *ref)
>  	 */
>  	buf = get_obj(tagged, &obj, &size, &eaten);
>  	if (!buf)
> -		die("missing object %s for %s",
> +		die(_("missing object %s for %s"),
>  		    sha1_to_hex(tagged), ref->refname);
>  	if (!obj)
> -		die("parse_object_buffer failed on %s for %s",
> +		die(_("parse_object_buffer failed on %s for %s"),
>  		    sha1_to_hex(tagged), ref->refname);
>  	grab_values(ref->value, 1, obj, buf, size);
>  	if (!eaten)
> @@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
>  	unsigned int kind;
>  
>  	if (flag & REF_BAD_NAME) {
> -		warning("ignoring ref with broken name %s", refname);
> +		warning(_("ignoring ref with broken name %s"), refname);
>  		return 0;
>  	}
>  
>  	if (flag & REF_ISBROKEN) {
> -		warning("ignoring broken ref %s", refname);
> +		warning(_("ignoring broken ref %s"), refname);
>  		return 0;
>  	}

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 14/22] refs/files-backend.c: mark strings for translation
  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
  0 siblings, 1 reply; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:43 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

I'd really prefer to avoid any code churn on this file before the
dust settles for David's and Michael's series (the former is in
'pu', the latter is not but was already rerolled once) both of which
touch this file heavily.

>  refs/files-backend.c | 86 ++++++++++++++++++++++++++--------------------------
>  1 file changed, 43 insertions(+), 43 deletions(-)
>
> diff --git a/refs/files-backend.c b/refs/files-backend.c
> index 81f68f8..bf76094 100644
> --- a/refs/files-backend.c
> +++ b/refs/files-backend.c
> @@ -203,7 +203,7 @@ static struct ref_entry *create_ref_entry(const char *refname,
>  
>  	if (check_name &&
>  	    check_refname_format(refname, REFNAME_ALLOW_ONELEVEL))
> -		die("Reference has invalid format: '%s'", refname);
> +		die(_("Reference has invalid format: '%s'"), refname);
>  	FLEX_ALLOC_STR(ref, name, refname);
>  	hashcpy(ref->u.value.oid.hash, sha1);
>  	oidclr(&ref->u.value.peeled);
> @@ -475,12 +475,12 @@ static int is_dup_ref(const struct ref_entry *ref1, const struct ref_entry *ref2
>  
>  	if ((ref1->flag & REF_DIR) || (ref2->flag & REF_DIR))
>  		/* This is impossible by construction */
> -		die("Reference directory conflict: %s", ref1->name);
> +		die(_("Reference directory conflict: %s"), ref1->name);
>  
>  	if (oidcmp(&ref1->u.value.oid, &ref2->u.value.oid))
> -		die("Duplicated ref, and SHA1s don't match: %s", ref1->name);
> +		die(_("Duplicated ref, and SHA1s don't match: %s"), ref1->name);
>  
> -	warning("Duplicated ref: %s", ref1->name);
> +	warning(_("Duplicated ref: %s"), ref1->name);
>  	return 1;
>  }
>  
> @@ -526,7 +526,7 @@ static int ref_resolves_to_object(struct ref_entry *entry)
>  	if (entry->flag & REF_ISBROKEN)
>  		return 0;
>  	if (!has_sha1_file(entry->u.value.oid.hash)) {
> -		error("%s does not point to a valid object!", entry->name);
> +		error(_("%s does not point to a valid object!"), entry->name);
>  		return 0;
>  	}
>  	return 1;
> @@ -653,7 +653,7 @@ static int do_for_each_entry_in_dirs(struct ref_dir *dir1,
>  				i1++;
>  				i2++;
>  			} else {
> -				die("conflict between reference and directory: %s",
> +				die(_("conflict between reference and directory: %s"),
>  				    e1->name);
>  			}
>  		} else {
> @@ -914,7 +914,7 @@ static void clear_packed_ref_cache(struct ref_cache *refs)
>  		struct packed_ref_cache *packed_refs = refs->packed;
>  
>  		if (packed_refs->lock)
> -			die("internal error: packed-ref cache cleared while locked");
> +			die(_("internal error: packed-ref cache cleared while locked"));
>  		refs->packed = NULL;
>  		release_packed_ref_cache(packed_refs);
>  	}
> @@ -1069,7 +1069,7 @@ static void read_packed_refs(FILE *f, struct ref_dir *dir)
>  
>  			if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
>  				if (!refname_is_safe(refname))
> -					die("packed refname is dangerous: %s", refname);
> +					die(_("packed refname is dangerous: %s"), refname);
>  				hashclr(sha1);
>  				flag |= REF_BAD_NAME | REF_ISBROKEN;
>  			}
> @@ -1239,7 +1239,7 @@ static void read_loose_refs(const char *dirname, struct ref_dir *dir)
>  			if (check_refname_format(refname.buf,
>  						 REFNAME_ALLOW_ONELEVEL)) {
>  				if (!refname_is_safe(refname.buf))
> -					die("loose refname is dangerous: %s", refname.buf);
> +					die(_("loose refname is dangerous: %s"), refname.buf);
>  				hashclr(sha1);
>  				flag |= REF_BAD_NAME | REF_ISBROKEN;
>  			}
> @@ -2099,7 +2099,7 @@ static int commit_packed_refs(void)
>  
>  	out = fdopen_lock_file(packed_ref_cache->lock, "w");
>  	if (!out)
> -		die_errno("unable to fdopen packed-refs descriptor");
> +		die_errno(_("unable to fdopen packed-refs descriptor"));
>  
>  	fprintf_or_die(out, "%s", PACKED_REFS_HEADER);
>  	do_for_each_entry_in_dir(get_packed_ref_dir(packed_ref_cache),
> @@ -2275,7 +2275,7 @@ int pack_refs(unsigned int flags)
>  				 pack_if_possible_fn, &cbdata);
>  
>  	if (commit_packed_refs())
> -		die_errno("unable to overwrite old ref-pack file");
> +		die_errno(_("unable to overwrite old ref-pack file"));
>  
>  	prune_refs(cbdata.ref_to_prune);
>  	return 0;
> @@ -2417,7 +2417,7 @@ static int rename_tmp_log(const char *newrefname)
>  			goto retry;
>  		/* fall through */
>  	default:
> -		error("unable to create directory for %s", newrefname);
> +		error(_("unable to create directory for %s"), newrefname);
>  		goto out;
>  	}
>  
> @@ -2429,7 +2429,7 @@ static int rename_tmp_log(const char *newrefname)
>  			 * Solaris 5.8 gives ENOTDIR.  Sheesh.
>  			 */
>  			if (remove_empty_directories(&path)) {
> -				error("Directory not empty: logs/%s", newrefname);
> +				error(_("Directory not empty: logs/%s"), newrefname);
>  				goto out;
>  			}
>  			goto retry;
> @@ -2441,8 +2441,8 @@ static int rename_tmp_log(const char *newrefname)
>  			 */
>  			goto retry;
>  		} else {
> -			error("unable to move logfile "TMP_RENAMED_LOG" to logs/%s: %s",
> -				newrefname, strerror(errno));
> +			error(_("unable to move logfile %s to logs/%s: %s"),
> +				TMP_RENAMED_LOG, newrefname, strerror(errno));
>  			goto out;
>  		}
>  	}
> @@ -2486,25 +2486,25 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>  	struct strbuf err = STRBUF_INIT;
>  
>  	if (log && S_ISLNK(loginfo.st_mode))
> -		return error("reflog for %s is a symlink", oldrefname);
> +		return error(_("reflog for %s is a symlink"), oldrefname);
>  
>  	symref = resolve_ref_unsafe(oldrefname, RESOLVE_REF_READING,
>  				    orig_sha1, &flag);
>  	if (flag & REF_ISSYMREF)
> -		return error("refname %s is a symbolic ref, renaming it is not supported",
> +		return error(_("refname %s is a symbolic ref, renaming it is not supported"),
>  			oldrefname);
>  	if (!symref)
> -		return error("refname %s not found", oldrefname);
> +		return error(_("refname %s not found"), oldrefname);
>  
>  	if (!rename_ref_available(oldrefname, newrefname))
>  		return 1;
>  
>  	if (log && rename(git_path("logs/%s", oldrefname), git_path(TMP_RENAMED_LOG)))
> -		return error("unable to move logfile logs/%s to "TMP_RENAMED_LOG": %s",
> -			oldrefname, strerror(errno));
> +		return error(_("unable to move logfile logs/%s to %s: %s"),
> +			     TMP_RENAMED_LOG, oldrefname, strerror(errno));
>  
>  	if (delete_ref(oldrefname, orig_sha1, REF_NODEREF)) {
> -		error("unable to delete old %s", oldrefname);
> +		error(_("unable to delete old %s"), oldrefname);
>  		goto rollback;
>  	}
>  
> @@ -2519,11 +2519,11 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>  			strbuf_release(&path);
>  
>  			if (result) {
> -				error("Directory not empty: %s", newrefname);
> +				error(_("Directory not empty: %s"), newrefname);
>  				goto rollback;
>  			}
>  		} else {
> -			error("unable to delete existing %s", newrefname);
> +			error(_("unable to delete existing %s"), newrefname);
>  			goto rollback;
>  		}
>  	}
> @@ -2535,7 +2535,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>  
>  	lock = lock_ref_sha1_basic(newrefname, NULL, NULL, NULL, 0, NULL, &err);
>  	if (!lock) {
> -		error("unable to rename '%s' to '%s': %s", oldrefname, newrefname, err.buf);
> +		error(_("unable to rename '%s' to '%s': %s"), oldrefname, newrefname, err.buf);
>  		strbuf_release(&err);
>  		goto rollback;
>  	}
> @@ -2543,7 +2543,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>  
>  	if (write_ref_to_lockfile(lock, orig_sha1, &err) ||
>  	    commit_ref_update(lock, orig_sha1, logmsg, 0, &err)) {
> -		error("unable to write current sha1 into %s: %s", newrefname, err.buf);
> +		error(_("unable to write current sha1 into %s: %s"), newrefname, err.buf);
>  		strbuf_release(&err);
>  		goto rollback;
>  	}
> @@ -2553,7 +2553,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>   rollback:
>  	lock = lock_ref_sha1_basic(oldrefname, NULL, NULL, NULL, 0, NULL, &err);
>  	if (!lock) {
> -		error("unable to lock %s for rollback: %s", oldrefname, err.buf);
> +		error(_("unable to lock %s for rollback: %s"), oldrefname, err.buf);
>  		strbuf_release(&err);
>  		goto rollbacklog;
>  	}
> @@ -2562,19 +2562,19 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
>  	log_all_ref_updates = 0;
>  	if (write_ref_to_lockfile(lock, orig_sha1, &err) ||
>  	    commit_ref_update(lock, orig_sha1, NULL, 0, &err)) {
> -		error("unable to write current sha1 into %s: %s", oldrefname, err.buf);
> +		error(_("unable to write current sha1 into %s: %s"), oldrefname, err.buf);
>  		strbuf_release(&err);
>  	}
>  	log_all_ref_updates = flag;
>  
>   rollbacklog:
>  	if (logmoved && rename(git_path("logs/%s", newrefname), git_path("logs/%s", oldrefname)))
> -		error("unable to restore logfile %s from %s: %s",
> +		error(_("unable to restore logfile %s from %s: %s"),
>  			oldrefname, newrefname, strerror(errno));
>  	if (!logmoved && log &&
>  	    rename(git_path(TMP_RENAMED_LOG), git_path("logs/%s", oldrefname)))
> -		error("unable to restore logfile %s from "TMP_RENAMED_LOG": %s",
> -			oldrefname, strerror(errno));
> +		error(_("unable to restore logfile %s from %s: %s"),
> +		      TMP_RENAMED_LOG, oldrefname, strerror(errno));
>  
>  	return 1;
>  }
> @@ -2817,7 +2817,7 @@ static int commit_ref_update(struct ref_lock *lock,
>  		}
>  	}
>  	if (commit_ref(lock)) {
> -		error("Couldn't set %s", lock->ref_name);
> +		error(_("Couldn't set %s"), lock->ref_name);
>  		unlock_ref(lock);
>  		return -1;
>  	}
> @@ -2862,7 +2862,7 @@ static int create_symref_locked(struct ref_lock *lock, const char *refname,
>  	}
>  
>  	if (!fdopen_lock_file(lock->lk, "w"))
> -		return error("unable to fdopen %s: %s",
> +		return error(_("unable to fdopen %s: %s"),
>  			     lock->lk->tempfile.filename.buf, strerror(errno));
>  
>  	update_symref_reflog(lock, refname, target, logmsg);
> @@ -2870,7 +2870,7 @@ static int create_symref_locked(struct ref_lock *lock, const char *refname,
>  	/* no error check; commit_ref will check ferror */
>  	fprintf(lock->lk->tempfile.fp, "ref: %s\n", target);
>  	if (commit_ref(lock) < 0)
> -		return error("unable to write symref for %s: %s", refname,
> +		return error(_("unable to write symref for %s: %s"), refname,
>  			     strerror(errno));
>  	return 0;
>  }
> @@ -2959,7 +2959,7 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void
>  
>  	/* Jump to the end */
>  	if (fseek(logfp, 0, SEEK_END) < 0)
> -		return error("cannot seek back reflog for %s: %s",
> +		return error(_("cannot seek back reflog for %s: %s"),
>  			     refname, strerror(errno));
>  	pos = ftell(logfp);
>  	while (!ret && 0 < pos) {
> @@ -2971,11 +2971,11 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void
>  		/* Fill next block from the end */
>  		cnt = (sizeof(buf) < pos) ? sizeof(buf) : pos;
>  		if (fseek(logfp, pos - cnt, SEEK_SET))
> -			return error("cannot seek back reflog for %s: %s",
> +			return error(_("cannot seek back reflog for %s: %s"),
>  				     refname, strerror(errno));
>  		nread = fread(buf, cnt, 1, logfp);
>  		if (nread != 1)
> -			return error("cannot read %d bytes from reflog for %s: %s",
> +			return error(_("cannot read %d bytes from reflog for %s: %s"),
>  				     cnt, refname, strerror(errno));
>  		pos -= cnt;
>  
> @@ -3097,7 +3097,7 @@ static int do_for_each_reflog(struct strbuf *name, each_ref_fn fn, void *cb_data
>  				struct object_id oid;
>  
>  				if (read_ref_full(name->buf, 0, oid.hash, NULL))
> -					retval = error("bad ref for %s", name->buf);
> +					retval = error(_("bad ref for %s"), name->buf);
>  				else
>  					retval = fn(name->buf, &oid, 0, cb_data);
>  			}
> @@ -3447,7 +3447,7 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
>  	 */
>  	lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err);
>  	if (!lock) {
> -		error("cannot lock ref '%s': %s", refname, err.buf);
> +		error(_("cannot lock ref '%s': %s"), refname, err.buf);
>  		strbuf_release(&err);
>  		return -1;
>  	}
> @@ -3474,7 +3474,7 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
>  		}
>  		cb.newlog = fdopen_lock_file(&reflog_lock, "w");
>  		if (!cb.newlog) {
> -			error("cannot fdopen %s (%s)",
> +			error(_("cannot fdopen %s (%s)"),
>  			      get_lock_file_path(&reflog_lock), strerror(errno));
>  			goto failure;
>  		}
> @@ -3497,21 +3497,21 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
>  			!is_null_sha1(cb.last_kept_sha1);
>  
>  		if (close_lock_file(&reflog_lock)) {
> -			status |= error("couldn't write %s: %s", log_file,
> +			status |= error(_("couldn't write %s: %s"), log_file,
>  					strerror(errno));
>  		} else if (update &&
>  			   (write_in_full(get_lock_file_fd(lock->lk),
>  				sha1_to_hex(cb.last_kept_sha1), 40) != 40 ||
>  			    write_str_in_full(get_lock_file_fd(lock->lk), "\n") != 1 ||
>  			    close_ref(lock) < 0)) {
> -			status |= error("couldn't write %s",
> +			status |= error(_("couldn't write %s"),
>  					get_lock_file_path(lock->lk));
>  			rollback_lock_file(&reflog_lock);
>  		} else if (commit_lock_file(&reflog_lock)) {
> -			status |= error("unable to write reflog '%s' (%s)",
> +			status |= error(_("unable to write reflog '%s' (%s)"),
>  					log_file, strerror(errno));
>  		} else if (update && commit_ref(lock)) {
> -			status |= error("couldn't set %s", lock->ref_name);
> +			status |= error(_("couldn't set %s"), lock->ref_name);
>  		}
>  	}
>  	free(log_file);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 15/22] remote-curl.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:50 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

All (or at least most) of these look old ones.  I'm inclined to say
we should do the whole thing post 2.8.0 release for this file.

>  remote-curl.c | 40 ++++++++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/remote-curl.c b/remote-curl.c
> index 15e48e2..d5b33aa 100644
> --- a/remote-curl.c
> +++ b/remote-curl.c
> @@ -177,7 +177,7 @@ static struct ref *parse_info_refs(struct discovery *heads)
>  			mid = &data[i];
>  		if (data[i] == '\n') {
>  			if (mid - start != 40)
> -				die("%sinfo/refs not valid: is this a git repository?",
> +				die(_("%sinfo/refs not valid: is this a git repository?"),
>  				    url.buf);
>  			data[i] = 0;
>  			ref_name = mid + 1;
> @@ -285,13 +285,13 @@ static struct discovery *discover_refs(const char *service, int for_push)
>  		break;
>  	case HTTP_MISSING_TARGET:
>  		show_http_message(&type, &charset, &buffer);
> -		die("repository '%s' not found", url.buf);
> +		die(_("repository '%s' not found"), url.buf);
>  	case HTTP_NOAUTH:
>  		show_http_message(&type, &charset, &buffer);
> -		die("Authentication failed for '%s'", url.buf);
> +		die(_("Authentication failed for '%s'"), url.buf);
>  	default:
>  		show_http_message(&type, &charset, &buffer);
> -		die("unable to access '%s': %s", url.buf, curl_errorstr);
> +		die(_("unable to access '%s': %s"), url.buf, curl_errorstr);
>  	}
>  
>  	last= xcalloc(1, sizeof(*last_discovery));
> @@ -314,7 +314,7 @@ static struct discovery *discover_refs(const char *service, int for_push)
>  		strbuf_reset(&exp);
>  		strbuf_addf(&exp, "# service=%s", service);
>  		if (strcmp(line, exp.buf))
> -			die("invalid server response; got '%s'", line);
> +			die(_("invalid server response; got '%s'"), line);
>  		strbuf_release(&exp);
>  
>  		/* The header can include additional metadata lines, up
> @@ -422,7 +422,7 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
>  			rpc->pos = 0;
>  			return CURLIOE_OK;
>  		}
> -		error("unable to rewind rpc post data - try increasing http.postBuffer");
> +		error(_("unable to rewind rpc post data - try increasing http.postBuffer"));
>  		return CURLIOE_FAILRESTART;
>  
>  	default:
> @@ -604,11 +604,11 @@ retry:
>  
>  		ret = git_deflate(&stream, Z_FINISH);
>  		if (ret != Z_STREAM_END)
> -			die("cannot deflate request; zlib deflate error %d", ret);
> +			die(_("cannot deflate request; zlib deflate error %d"), ret);
>  
>  		ret = git_deflate_end_gently(&stream);
>  		if (ret != Z_OK)
> -			die("cannot deflate request; zlib end error %d", ret);
> +			die(_("cannot deflate request; zlib end error %d"), ret);
>  
>  		gzip_size = stream.total_out;
>  
> @@ -726,7 +726,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
>  
>  	ALLOC_ARRAY(targets, nr_heads);
>  	if (options.depth)
> -		die("dumb http transport does not support --depth");
> +		die(_("dumb http transport does not support --depth"));
>  	for (i = 0; i < nr_heads; i++)
>  		targets[i] = xstrdup(oid_to_hex(&to_fetch[i]->old_oid));
>  
> @@ -743,7 +743,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
>  		free(targets[i]);
>  	free(targets);
>  
> -	return ret ? error("fetch failed.") : 0;
> +	return ret ? error(_("fetch failed.")) : 0;
>  }
>  
>  static int fetch_git(struct discovery *heads,
> @@ -787,7 +787,7 @@ static int fetch_git(struct discovery *heads,
>  	for (i = 0; i < nr_heads; i++) {
>  		struct ref *ref = to_fetch[i];
>  		if (!*ref->name)
> -			die("cannot fetch by sha1 over smart http");
> +			die(_("cannot fetch by sha1 over smart http"));
>  		packet_buf_write(&preamble, "%s %s\n",
>  				 oid_to_hex(&ref->old_oid), ref->name);
>  	}
> @@ -832,13 +832,13 @@ static void parse_fetch(struct strbuf *buf)
>  			struct object_id old_oid;
>  
>  			if (get_oid_hex(p, &old_oid))
> -				die("protocol error: expected sha/ref, got %s'", p);
> +				die(_("protocol error: expected sha/ref, got %s'"), p);
>  			if (p[GIT_SHA1_HEXSZ] == ' ')
>  				name = p + GIT_SHA1_HEXSZ + 1;
>  			else if (!p[GIT_SHA1_HEXSZ])
>  				name = "";
>  			else
> -				die("protocol error: expected sha/ref, got %s'", p);
> +				die(_("protocol error: expected sha/ref, got %s'"), p);
>  
>  			ref = alloc_ref(name);
>  			oidcpy(&ref->old_oid, &old_oid);
> @@ -850,7 +850,7 @@ static void parse_fetch(struct strbuf *buf)
>  			to_fetch[nr_heads++] = ref;
>  		}
>  		else
> -			die("http transport does not support %s", buf->buf);
> +			die(_("http transport does not support %s"), buf->buf);
>  
>  		strbuf_reset(buf);
>  		if (strbuf_getline_lf(buf, stdin) == EOF)
> @@ -886,7 +886,7 @@ static int push_dav(int nr_spec, char **specs)
>  		argv_array_push(&child.args, specs[i]);
>  
>  	if (run_command(&child))
> -		die("git-http-push failed");
> +		die(_("git-http-push failed"));
>  	return 0;
>  }
>  
> @@ -962,7 +962,7 @@ static void parse_push(struct strbuf *buf)
>  			specs[nr_spec++] = xstrdup(buf->buf + 5);
>  		}
>  		else
> -			die("http transport does not support %s", buf->buf);
> +			die(_("http transport does not support %s"), buf->buf);
>  
>  		strbuf_reset(buf);
>  		if (strbuf_getline_lf(buf, stdin) == EOF)
> @@ -994,7 +994,7 @@ int main(int argc, const char **argv)
>  	git_extract_argv0_path(argv[0]);
>  	setup_git_directory_gently(&nongit);
>  	if (argc < 2) {
> -		error("remote-curl: usage: git remote-curl <remote> [<url>]");
> +		error(_("remote-curl: usage: git remote-curl <remote> [<url>]"));
>  		return 1;
>  	}
>  
> @@ -1017,14 +1017,14 @@ int main(int argc, const char **argv)
>  
>  		if (strbuf_getline_lf(&buf, stdin) == EOF) {
>  			if (ferror(stdin))
> -				error("remote-curl: error reading command stream from git");
> +				error(_("remote-curl: error reading command stream from git"));
>  			return 1;
>  		}
>  		if (buf.len == 0)
>  			break;
>  		if (starts_with(buf.buf, "fetch ")) {
>  			if (nongit)
> -				die("remote-curl: fetch attempted without a local repo");
> +				die(_("remote-curl: fetch attempted without a local repo"));
>  			parse_fetch(&buf);
>  
>  		} else if (!strcmp(buf.buf, "list") || starts_with(buf.buf, "list ")) {
> @@ -1060,7 +1060,7 @@ int main(int argc, const char **argv)
>  			printf("\n");
>  			fflush(stdout);
>  		} else {
> -			error("remote-curl: unknown command '%s' from git", buf.buf);
> +			error(_("remote-curl: unknown command '%s' from git"), buf.buf);
>  			return 1;
>  		}
>  		strbuf_reset(&buf);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 16/22] run-command.c: mark strings for translation
  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
  0 siblings, 1 reply; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:52 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Stefan Beller

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

This is new and there aren't many non-BUG messages that are not
marked, so let's take this one for 2.8.0.


>  run-command.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/run-command.c b/run-command.c
> index 863dad5..1ee2357 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -909,7 +909,7 @@ static int default_start_failure(struct child_process *cp,
>  {
>  	int i;
>  
> -	strbuf_addstr(err, "Starting a child failed:");
> +	strbuf_addstr(err, _("Starting a child failed:"));
>  	for (i = 0; cp->argv[i]; i++)
>  		strbuf_addf(err, " %s", cp->argv[i]);
>  
> @@ -927,7 +927,7 @@ static int default_task_finished(int result,
>  	if (!result)
>  		return 0;
>  
> -	strbuf_addf(err, "A child failed with return code %d:", result);
> +	strbuf_addf(err, _("A child failed with return code %d:"), result);
>  	for (i = 0; cp->argv[i]; i++)
>  		strbuf_addf(err, " %s", cp->argv[i]);

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 19/22] trailer.c: mark strings for translation
  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
  0 siblings, 0 replies; 47+ messages in thread
From: Junio C Hamano @ 2016-02-29 18:55 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

I'll take this one, even though it is quite old, as the file has a
serious amount of messages that are already marked.

>  trailer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/trailer.c b/trailer.c
> index 94b387b..8e48a5c 100644
> --- a/trailer.c
> +++ b/trailer.c
> @@ -234,7 +234,7 @@ static const char *apply_command(const char *command, const char *arg)
>  	cp.use_shell = 1;
>  
>  	if (capture_command(&cp, &buf, 1024)) {
> -		error("running trailer command '%s' failed", cmd.buf);
> +		error(_("running trailer command '%s' failed"), cmd.buf);
>  		strbuf_release(&buf);
>  		result = xstrdup("");
>  	} else {

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 16/22] run-command.c: mark strings for translation
  2016-02-29 18:52   ` Junio C Hamano
@ 2016-03-01  0:00     ` Stefan Beller
  0 siblings, 0 replies; 47+ messages in thread
From: Stefan Beller @ 2016-03-01  0:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nguyễn Thái Ngọc, git@vger.kernel.org

On Mon, Feb 29, 2016 at 10:52 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>
> This is new and there aren't many non-BUG messages that are not
> marked, so let's take this one for 2.8.0.

This would collide with "[PATCH] run-command: do not pass child
process data into callbacks",
dropping this patch would be easiest.

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 14/22] refs/files-backend.c: mark strings for translation
  2016-02-29 18:43   ` Junio C Hamano
@ 2016-03-01 10:40     ` Duy Nguyen
  0 siblings, 0 replies; 47+ messages in thread
From: Duy Nguyen @ 2016-03-01 10:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Tue, Mar 1, 2016 at 1:43 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>
> I'd really prefer to avoid any code churn on this file before the
> dust settles for David's and Michael's series (the former is in
> 'pu', the latter is not but was already rerolled once) both of which
> touch this file heavily.

Yeah. I actually dropped a patch on fetch-pack.c because my series
shallow-deepen also changes a lot there, then somehow I forgot that
David's series moves a bunch of refs code around. I'll keep an eye of
those series and resend once they enter 'next'.
-- 
Duy

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH 11/22] ident.c: mark strings for translation
  2016-02-29 18:34   ` Junio C Hamano
@ 2016-03-01 14:56     ` Jeff King
  0 siblings, 0 replies; 47+ messages in thread
From: Jeff King @ 2016-03-01 14:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy, git

On Mon, Feb 29, 2016 at 10:34:59AM -0800, Junio C Hamano wrote:

> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
> 
> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> > ---
> 
> All (or at least most of) these look old ones; even the ones blamed
> to 59f92959 (fmt_ident: refactor strictness checks, 2016-02-04) had
> original in the same file without _().
> 
> I'm inclined to say we should do the whole thing post 2.8.0 release
> for this file.

I guess I'm cc'd as the author of some of these. These all look fine to
me (and the other one for credential-*). I'm happy to have them down now
or post-2.8.0 (it is really not any work for me, but for the
translators).

-Peff

^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH 00/22] Mark more strings for translation
@ 2018-06-02  4:32 Nguyễn Thái Ngọc Duy
  0 siblings, 0 replies; 47+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-06-02  4:32 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

I originally wanted to have a look regularly at what's in 'pu', catch
translatable strings that are not marked so and ask for updates. But I
failed horribly at that, so for this cycle I just looked at all the
changes between the last release and master and marked strings.

This series probably won't end up in 2.18 because now is probably too
late for big changes, which is fine.

Nguyễn Thái Ngọc Duy (22):
  archive-tar.c: mark more strings for translation
  archive-zip.c: mark more strings for translation
  builtin/config.c: mark more strings for translation
  builtin/grep.c: mark strings for translation and no full stops
  builtin/pack-objects.c: mark more strings for translation
  builtin/replace.c: mark more strings for translation
  commit-graph.c: mark more strings for translation
  config.c: mark more strings for translation
  connect.c: mark more strings for translation
  convert.c: mark more strings for translation
  dir.c: mark more strings for translation
  environment.c: mark more strings for translation
  exec-cmd.c: mark more strings for translation
  object.c: mark more strings for translation
  pkt-line.c: mark more strings for translation
  refs.c: mark more strings for translation
  refspec.c: mark more strings for translation
  replace-object.c: mark more strings for translation
  sequencer.c: mark more strings for translation
  sha1-file.c: mark more strings for translation
  transport.c: mark more strings for translation
  transport-helper.c: mark more strings for translation

 archive-tar.c                         |  12 +--
 archive-zip.c                         |  14 ++--
 builtin/config.c                      |  48 +++++------
 builtin/grep.c                        |  12 +--
 builtin/pack-objects.c                | 108 ++++++++++++-------------
 builtin/replace.c                     |  90 ++++++++++-----------
 commit-graph.c                        |  20 ++---
 config.c                              |  76 +++++++++---------
 connect.c                             |  87 ++++++++++----------
 convert.c                             |  42 +++++-----
 dir.c                                 |   8 +-
 environment.c                         |   4 +-
 exec-cmd.c                            |   2 +-
 object.c                              |  10 +--
 pkt-line.c                            |  26 +++---
 refs.c                                |  40 +++++-----
 refspec.c                             |   2 +-
 replace-object.c                      |   6 +-
 sequencer.c                           |  26 +++---
 sha1-file.c                           | 110 +++++++++++++-------------
 t/t0021-conversion.sh                 |   2 +-
 t/t1305-config-include.sh             |   2 +-
 t/t1308-config-set.sh                 |   2 +-
 t/t1400-update-ref.sh                 |  20 ++---
 t/t1404-update-ref-errors.sh          |   4 +-
 t/t1450-fsck.sh                       |   2 +-
 t/t3005-ls-files-relative.sh          |   4 +-
 t/t3210-pack-refs.sh                  |   2 +-
 t/t3310-notes-merge-manual-resolve.sh |   6 +-
 t/t5500-fetch-pack.sh                 |   2 +-
 t/t5505-remote.sh                     |   2 +-
 t/t5512-ls-remote.sh                  |   2 +-
 t/t5570-git-daemon.sh                 |   6 +-
 t/t5801-remote-helpers.sh             |   8 +-
 t/t7063-status-untracked-cache.sh     |   2 +-
 t/t7400-submodule-basic.sh            |   2 +-
 transport-helper.c                    |  89 ++++++++++-----------
 transport.c                           |  18 ++---
 38 files changed, 466 insertions(+), 452 deletions(-)

-- 
2.18.0.rc0.309.g77c7720784


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2018-06-02  4:32 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-28 18:57   ` 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
  -- strict thread matches above, loose matches on Subject: below --
2018-06-02  4:32 Nguyễn Thái Ngọc Duy

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).