git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 07/25] gettextize: git-grep basic messages
Date: Thu,  2 Sep 2010 19:40:28 +0000	[thread overview]
Message-ID: <1283456446-22577-8-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1283373845-2022-1-git-send-email-avarab@gmail.com>

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/grep.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index da32f3d..af5d227 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -249,7 +249,7 @@ static void start_threads(struct grep_opt *opt)
 		err = pthread_create(&threads[i], NULL, run, o);
 
 		if (err)
-			die("grep: failed to create thread: %s",
+			die(_("grep: failed to create thread: %s"),
 			    strerror(err));
 	}
 }
@@ -454,7 +454,7 @@ static void *load_sha1(const unsigned char *sha1, unsigned long *size,
 	void *data = lock_and_read_sha1_file(sha1, &type, size);
 
 	if (!data)
-		error("'%s': unable to read %s", name, sha1_to_hex(sha1));
+		error(_("'%s': unable to read %s"), name, sha1_to_hex(sha1));
 
 	return data;
 }
@@ -505,7 +505,7 @@ static void *load_file(const char *filename, size_t *sz)
 	if (lstat(filename, &st) < 0) {
 	err_ret:
 		if (errno != ENOENT)
-			error("'%s': %s", filename, strerror(errno));
+			error(_("'%s': %s"), filename, strerror(errno));
 		return 0;
 	}
 	if (!S_ISREG(st.st_mode))
@@ -516,7 +516,7 @@ static void *load_file(const char *filename, size_t *sz)
 		goto err_ret;
 	data = xmalloc(*sz + 1);
 	if (st.st_size != read_in_full(i, data, *sz)) {
-		error("'%s': short read %s", filename, strerror(errno));
+		error(_("'%s': short read %s"), filename, strerror(errno));
 		close(i);
 		free(data);
 		return 0;
@@ -578,7 +578,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)
 	argv[path_list->nr] = NULL;
 
 	if (prefix && chdir(prefix))
-		die("Failed to chdir: %s", prefix);
+		die(_("Failed to chdir: %s"), prefix);
 	status = run_command_v_opt(argv, RUN_USING_SHELL);
 	if (status)
 		exit(status);
@@ -668,7 +668,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
 
 			data = lock_and_read_sha1_file(entry.sha1, &type, &size);
 			if (!data)
-				die("unable to read tree (%s)",
+				die(_("unable to read tree (%s)"),
 				    sha1_to_hex(entry.sha1));
 			init_tree_desc(&sub, data, size);
 			hit |= grep_tree(opt, paths, &sub, tree_name, down);
@@ -694,13 +694,13 @@ static int grep_object(struct grep_opt *opt, const char **paths,
 		data = read_object_with_reference(obj->sha1, tree_type,
 						  &size, NULL);
 		if (!data)
-			die("unable to read tree (%s)", sha1_to_hex(obj->sha1));
+			die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
 		init_tree_desc(&tree, data, size);
 		hit = grep_tree(opt, paths, &tree, name, "");
 		free(data);
 		return hit;
 	}
-	die("unable to grep from object of type %s", typename(obj->type));
+	die(_("unable to grep from object of type %s"), typename(obj->type));
 }
 
 static int grep_objects(struct grep_opt *opt, const char **paths,
@@ -752,7 +752,7 @@ static int context_callback(const struct option *opt, const char *arg,
 	}
 	value = strtol(arg, (char **)&endp, 10);
 	if (*endp) {
-		return error("switch `%c' expects a numerical value",
+		return error(_("switch `%c' expects a numerical value"),
 			     opt->short_name);
 	}
 	grep_opt->pre_context = grep_opt->post_context = value;
@@ -768,7 +768,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
 
 	patterns = fopen(arg, "r");
 	if (!patterns)
-		die_errno("cannot open '%s'", arg);
+		die_errno(_("cannot open '%s'"), arg);
 	while (strbuf_getline(&sb, patterns, '\n') == 0) {
 		char *s;
 		size_t len;
@@ -1009,11 +1009,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (!opt.pattern_list)
-		die("no pattern given.");
+		die(_("no pattern given."));
 	if (!opt.fixed && opt.ignore_case)
 		opt.regflags |= REG_ICASE;
 	if ((opt.regflags != REG_NEWLINE) && opt.fixed)
-		die("cannot mix --fixed-strings and regexp");
+		die(_("cannot mix --fixed-strings and regexp"));
 
 #ifndef NO_PTHREADS
 	if (online_cpus() == 1 || !grep_threads_ok(&opt))
@@ -1038,7 +1038,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		if (!get_sha1(arg, sha1)) {
 			struct object *object = parse_object(sha1);
 			if (!object)
-				die("bad object %s", arg);
+				die(_("bad object %s"), arg);
 			add_object_array(object, arg, &list);
 			continue;
 		}
@@ -1065,7 +1065,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (show_in_pager && (cached || list.nr))
-		die("--open-files-in-pager only works on the worktree");
+		die(_("--open-files-in-pager only works on the worktree"));
 
 	if (show_in_pager && opt.pattern_list && !opt.pattern_list->next) {
 		const char *pager = path_list.items[0].string;
@@ -1090,9 +1090,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 
 	if (!use_index) {
 		if (cached)
-			die("--cached cannot be used with --no-index.");
+			die(_("--cached cannot be used with --no-index."));
 		if (list.nr)
-			die("--no-index cannot be used with revs.");
+			die(_("--no-index cannot be used with revs."));
 		hit = grep_directory(&opt, paths);
 	} else if (!list.nr) {
 		if (!cached)
@@ -1101,7 +1101,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		hit = grep_cache(&opt, paths, cached);
 	} else {
 		if (cached)
-			die("both --cached and trees are given.");
+			die(_("both --cached and trees are given."));
 		hit = grep_objects(&opt, paths, &list);
 	}
 
-- 
1.7.2.2.614.g1dc9

  parent reply	other threads:[~2010-09-02 19:41 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 20:43 [PATCH 00/13] gettextize the first 4 C mainporcelain common commands Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 01/13] git-clone: use builtin.h to get gettext.h Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 02/13] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 03/13] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 04/13] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 05/13] gettextize: git-add refresh_index message Ævar Arnfjörð Bjarmason
2010-09-02  4:21   ` Jonathan Nieder
2010-09-01 20:43 ` [PATCH 06/13] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 07/13] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 08/13] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 09/13] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 10/13] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 11/13] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 12/13] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 13/13] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 00/25] [CONTINUED] gettextize all C mainporcelain common commands Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 01/25] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 02/25] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 03/25] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 04/25] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 05/25] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 06/25] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
2010-09-02 19:59   ` Jonathan Nieder
2010-09-02 20:13     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:28     ` Jeff King
2010-09-02 20:48       ` Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` Ævar Arnfjörð Bjarmason [this message]
2010-09-02 19:40 ` [PATCH 08/25] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 09/25] gettextize: git-format-patch --cover-letter message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 10/25] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
2010-09-02 20:09   ` Jonathan Nieder
2010-09-02 20:30     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:37       ` Jonathan Nieder
2010-09-02 20:54         ` Ævar Arnfjörð Bjarmason
2010-09-02 21:13           ` Jonathan Nieder
2010-09-02 22:45             ` Ævar Arnfjörð Bjarmason
2010-09-02 23:04               ` Jonathan Nieder
2010-09-03 12:13                 ` Ævar Arnfjörð Bjarmason
2010-09-03 17:51                   ` Jonathan Nieder
2010-09-03 18:06                     ` Ævar Arnfjörð Bjarmason
2010-09-03 13:01         ` Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 11/25] gettextize: git-merge "In-index merge" message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 12/25] gettextize: git-merge "Merge made by %s." message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 13/25] gettextize: git-merge remaining cmd_merge messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 14/25] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 15/25] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 16/25] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 17/25] builtin: use builtin.h in git-reset Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 18/25] gettextize: git-reset basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 19/25] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
2010-09-15 11:17   ` Peter Krefting
2010-09-15 15:50     ` Thomas Rast
2010-09-02 19:40 ` [PATCH 20/25] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 21/25] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 22/25] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 23/25] builtin: use builtin.h in git-status Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 24/25] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
2010-09-02 20:28   ` Jonathan Nieder
2010-09-02 20:41     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:47       ` Jonathan Nieder
2010-09-02 19:40 ` [PATCH 25/25] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
2010-09-02 20:25   ` Jonathan Nieder
2010-09-02 20:34     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283456446-22577-8-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).