Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/replace.c | 90 +++
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 6da2411e14..c203534fd3 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -54,7 +54,7 @@ static int show_reference(const char *refname, const struct
object_id *oid,
enum object_type obj_type, repl_type;
if (get_oid(refname, &object))
- return error("Failed to resolve '%s' as a valid
ref.", refname);
+ return error(_("failed to resolve '%s' as a
valid ref"), refname);
obj_type = oid_object_info(the_repository, &object,
NULL);
@@ -83,8 +83,8 @@ static int list_replace_refs(const char *pattern, const char
*format)
else if (!strcmp(format, "long"))
data.format = REPLACE_FORMAT_LONG;
else
- return error("invalid replace format '%s'\n"
-"valid formats are 'short', 'medium' and 'long'\n",
+ return error(_("invalid replace format '%s'\n"
+ "valid formats are 'short', 'medium' and
'long'"),
format);
for_each_replace_ref(the_repository, show_reference, (void *)&data);
@@ -108,7 +108,7 @@ static int for_each_replace_name(const char **argv,
each_replace_name_fn fn)
for (p = argv; *p; p++) {
if (get_oid(*p, &oid)) {
- error("Failed to resolve '%s' as a valid ref.", *p);
+ error("failed to resolve '%s' as a valid ref", *p);
had_error = 1;
continue;
}
@@ -118,7 +118,7 @@ static int for_each_replace_name(const char **argv,
each_replace_name_fn fn)
full_hex = ref.buf + base_len;
if (read_ref(ref.buf, &oid)) {
- error("replace ref '%s' not found.", full_hex);
+ error(_("replace ref '%s' not found"), full_hex);
had_error = 1;
continue;
}
@@ -134,7 +134,7 @@ static int delete_replace_ref(const char *name, const char
*ref,
{
if (delete_ref(NULL, ref, oid, 0))
return 1;
- printf("Deleted replace ref '%s'\n", name);
+ printf_ln(_("Deleted replace ref '%s'"), name);
return 0;
}
@@ -146,12 +146,12 @@ static int check_ref_valid(struct object_id *object,
strbuf_reset(ref);
strbuf_addf(ref, "%s%s", git_replace_ref_base, oid_to_hex(object));
if (check_refname_format(ref->buf, 0))
- return error("'%s' is not a valid ref name.", ref->buf);
+ return error(_("'%s' is not a valid ref name"), ref->buf);
if (read_ref(ref->buf, prev))
oidclr(prev);
else if (!force)
- return error("replace ref '%s' already exists", ref->buf);
+ return error(_("replace ref '%s' already exists"), ref->buf);
return 0;
}
@@ -171,10 +171,10 @@ static int replace_object_oid(const char *object_ref,
obj_type = oid_object_info(the_repository, object, NULL);
repl_type = oid_object_info(the_repository, repl, NULL);
if (!force && obj_type != repl_type)
- return error("Objects must be of the same type.\n"
-"'%s' points to a replaced object of type '%s'\n"
-"while '%s' points to a replacement object of "
-"type '%s'.",
+ return error(_("objects must be of the same type.\n"
+ "'%s' points to a replaced object of type '%s'\n"
+ "while '%s' points to a replacement object of "
+ "type '%s'"),
object_ref, type_name(obj_type),
replace_ref, type_name(repl_type));
@@ -200,10 +200,10 @@ static int replace_object(const char *object_ref, const
char *replace_ref, int f
struct object_id object, repl;
if (get_oid(object_ref, &object))
- return error("Failed to resolve '%s' as a valid ref.",
+ return error(_("failed to resolve '%s' as a valid ref"),
object_ref);
if (get_oid(replace_ref, &repl))
- return error("Failed to resolve '%s' as a valid ref.",
+ return error(_("failed to resolve '%s' as a valid ref"),
replace_ref);
return replace_object_oid(object_ref, &object, replace_ref, &repl,
force);
@@ -222,7 +222,7 @@ static int export_object(const struct object_id *oid, enum
object_type type,
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 06