[PATCH 07/25] gettextize: git-grep basic messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]