@matheusbsbs / matheus-bagliano / commits / b50a64e818
Fork 0

i18n: git-reset basic messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 22, 2011 at 23:42 UTC b50a64e81875944985f84df9324c7624776d6cf8
1 file changed +13 -13
builtin/reset.c
+13 -13
@@ -92,20 +92,20 @@ static int reset_index_file(const unsigned char *sha1, int reset_type, int quiet
92 if (reset_type == KEEP) {
93 unsigned char head_sha1[20];
94 if (get_sha1("HEAD", head_sha1))
95 - return error("You do not have a valid HEAD.");
95 + return error(_("You do not have a valid HEAD."));
96 if (!fill_tree_descriptor(desc, head_sha1))
97 - return error("Failed to find tree of HEAD.");
97 + return error(_("Failed to find tree of HEAD."));
98 nr++;
99 opts.fn = twoway_merge;
100 }
101
102 if (!fill_tree_descriptor(desc + nr - 1, sha1))
103 - return error("Failed to find tree of %s.", sha1_to_hex(sha1));
103 + return error(_("Failed to find tree of %s."), sha1_to_hex(sha1));
104 if (unpack_trees(nr, desc, &opts))
105 return -1;
106 if (write_cache(newfd, active_cache, active_nr) ||
107 commit_locked_index(lock))
108 - return error("Could not write new index file.");
108 + return error(_("Could not write new index file."));
109
110 return 0;
111 }
@@ -115,7 +115,7 @@ static void print_new_head_line(struct commit *commit)
115 const char *hex, *body;
116
117 hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
118 - printf("HEAD is now at %s", hex);
118 + printf(_("HEAD is now at %s"), hex);
119 body = strstr(commit->buffer, "\n\n");
120 if (body) {
121 const char *eol;
@@ -139,7 +139,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
139 }
140
141 if (read_cache() < 0)
142 - return error("Could not read index");
142 + return error(_("Could not read index"));
143
144 result = refresh_index(&the_index, (flags), NULL, NULL,
145 "Unstaged changes after reset:") ? 1 : 0;
@@ -167,7 +167,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
167 ce = make_cache_entry(one->mode, one->sha1, one->path,
168 0, 0);
169 if (!ce)
170 - die("make_cache_entry failed for path '%s'",
170 + die(_("make_cache_entry failed for path '%s'"),
171 one->path);
172 add_cache_entry(ce, ADD_CACHE_OK_TO_ADD |
173 ADD_CACHE_OK_TO_REPLACE);
@@ -222,7 +222,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
222 if (!rla)
223 rla = sep = "";
224 if (snprintf(buf, size, "%s%s%s", rla, sep, action) >= size)
225 - warning("Reflog action message too long: %.*s...", 50, buf);
225 + warning(_("Reflog action message too long: %.*s..."), 50, buf);
226 }
227
228 static void die_if_unmerged_cache(int reset_type)
@@ -300,16 +300,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
300 }
301
302 if (get_sha1(rev, sha1))
303 - die("Failed to resolve '%s' as a valid ref.", rev);
303 + die(_("Failed to resolve '%s' as a valid ref."), rev);
304
305 commit = lookup_commit_reference(sha1);
306 if (!commit)
307 - die("Could not parse object '%s'.", rev);
307 + die(_("Could not parse object '%s'."), rev);
308 hashcpy(sha1, commit->object.sha1);
309
310 if (patch_mode) {
311 if (reset_type != NONE)
312 - die("--patch is incompatible with --{hard,mixed,soft}");
312 + die(_("--patch is incompatible with --{hard,mixed,soft}"));
313 return interactive_reset(rev, argv + i, prefix);
314 }
315
@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
318 * affecting the working tree nor HEAD. */
319 if (i < argc) {
320 if (reset_type == MIXED)
321 - warning("--mixed with paths is deprecated; use 'git reset -- <paths>' instead.");
321 + warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
322 else if (reset_type != NONE)
323 die("Cannot do %s reset with paths.",
324 reset_type_names[reset_type]);
@@ -348,7 +348,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
348 if (reset_type == KEEP)
349 err = err || reset_index_file(sha1, MIXED, quiet);
350 if (err)
351 - die("Could not reset index file to revision '%s'.", rev);
351 + die(_("Could not reset index file to revision '%s'."), rev);
352 }
353
354 /* Any resets update HEAD to the head being switched to,