Re: [PATCH v2 02/23] archive-tar.c: mark more strings for translation

2018-07-20 Thread Duy Nguyen
On Thu, Jul 19, 2018 at 8:21 PM Junio C Hamano  wrote:
>
> Nguyễn Thái Ngọc Duy   writes:
>
> > @@ -256,7 +256,7 @@ static int write_tar_entry(struct archiver_args *args,
> >   *header.typeflag = TYPEFLAG_REG;
> >   mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
> >   } else {
> > - return error("unsupported file mode: 0%o (SHA1: %s)",
> > + return error(_("unsupported file mode: 0%o (SHA1: %s)"),
> >mode, oid_to_hex(oid));
>
> This is no longer sha1_to_hex(); the "SHA1" in the message should
> probably have been updated when it happened.
>
> Cleaning it up is outside the scope of this patch.

Yeah. I also asked Brian [1] what to use here instead. I think it's
much easier to go through git.pot then fix all at once. Whatever
leftover after that could be fixed as we see them.

[1] 
https://public-inbox.org/git/20180603182724.ga288...@genre.crustytoothpaste.net/

> #leftoverbits
-- 
Duy


Re: [PATCH v2 02/23] archive-tar.c: mark more strings for translation

2018-07-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy   writes:

> @@ -256,7 +256,7 @@ static int write_tar_entry(struct archiver_args *args,
>   *header.typeflag = TYPEFLAG_REG;
>   mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
>   } else {
> - return error("unsupported file mode: 0%o (SHA1: %s)",
> + return error(_("unsupported file mode: 0%o (SHA1: %s)"),
>mode, oid_to_hex(oid));

This is no longer sha1_to_hex(); the "SHA1" in the message should
probably have been updated when it happened.

Cleaning it up is outside the scope of this patch. 

#leftoverbits


[PATCH v2 02/23] archive-tar.c: mark more strings for translation

2018-07-18 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy 
---
 archive-tar.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/archive-tar.c b/archive-tar.c
index b6f58ddf38..68e72d9176 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -121,7 +121,7 @@ static int stream_blocked(const struct object_id *oid)
 
st = open_istream(oid, &type, &sz, NULL);
if (!st)
-   return error("cannot stream blob %s", oid_to_hex(oid));
+   return error(_("cannot stream blob %s"), oid_to_hex(oid));
for (;;) {
readlen = read_istream(st, buf, sizeof(buf));
if (readlen <= 0)
@@ -256,7 +256,7 @@ static int write_tar_entry(struct archiver_args *args,
*header.typeflag = TYPEFLAG_REG;
mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
} else {
-   return error("unsupported file mode: 0%o (SHA1: %s)",
+   return error(_("unsupported file mode: 0%o (SHA1: %s)"),
 mode, oid_to_hex(oid));
}
if (pathlen > sizeof(header.name)) {
@@ -283,7 +283,7 @@ static int write_tar_entry(struct archiver_args *args,
enum object_type type;
buffer = object_file_to_archive(args, path, oid, old_mode, 
&type, &size);
if (!buffer)
-   return error("cannot read %s", oid_to_hex(oid));
+   return error(_("cannot read %s"), oid_to_hex(oid));
} else {
buffer = NULL;
size = 0;
@@ -454,17 +454,17 @@ static int write_tar_filter_archive(const struct archiver 
*ar,
filter.in = -1;
 
if (start_command(&filter) < 0)
-   die_errno("unable to start '%s' filter", argv[0]);
+   die_errno(_("unable to start '%s' filter"), argv[0]);
close(1);
if (dup2(filter.in, 1) < 0)
-   die_errno("unable to redirect descriptor");
+   die_errno(_("unable to redirect descriptor"));
close(filter.in);
 
r = write_tar_archive(ar, args);
 
close(1);
if (finish_command(&filter) != 0)
-   die("'%s' filter reported error", argv[0]);
+   die(_("'%s' filter reported error"), argv[0]);
 
strbuf_release(&cmd);
return r;
-- 
2.18.0.rc2.476.g39500d3211



[PATCH v2 02/23] archive-tar.c: mark more strings for translation

2018-06-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy 
---
 archive-tar.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/archive-tar.c b/archive-tar.c
index b6f58ddf38..68e72d9176 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -121,7 +121,7 @@ static int stream_blocked(const struct object_id *oid)
 
st = open_istream(oid, &type, &sz, NULL);
if (!st)
-   return error("cannot stream blob %s", oid_to_hex(oid));
+   return error(_("cannot stream blob %s"), oid_to_hex(oid));
for (;;) {
readlen = read_istream(st, buf, sizeof(buf));
if (readlen <= 0)
@@ -256,7 +256,7 @@ static int write_tar_entry(struct archiver_args *args,
*header.typeflag = TYPEFLAG_REG;
mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
} else {
-   return error("unsupported file mode: 0%o (SHA1: %s)",
+   return error(_("unsupported file mode: 0%o (SHA1: %s)"),
 mode, oid_to_hex(oid));
}
if (pathlen > sizeof(header.name)) {
@@ -283,7 +283,7 @@ static int write_tar_entry(struct archiver_args *args,
enum object_type type;
buffer = object_file_to_archive(args, path, oid, old_mode, 
&type, &size);
if (!buffer)
-   return error("cannot read %s", oid_to_hex(oid));
+   return error(_("cannot read %s"), oid_to_hex(oid));
} else {
buffer = NULL;
size = 0;
@@ -454,17 +454,17 @@ static int write_tar_filter_archive(const struct archiver 
*ar,
filter.in = -1;
 
if (start_command(&filter) < 0)
-   die_errno("unable to start '%s' filter", argv[0]);
+   die_errno(_("unable to start '%s' filter"), argv[0]);
close(1);
if (dup2(filter.in, 1) < 0)
-   die_errno("unable to redirect descriptor");
+   die_errno(_("unable to redirect descriptor"));
close(filter.in);
 
r = write_tar_archive(ar, args);
 
close(1);
if (finish_command(&filter) != 0)
-   die("'%s' filter reported error", argv[0]);
+   die(_("'%s' filter reported error"), argv[0]);
 
strbuf_release(&cmd);
return r;
-- 
2.18.0.rc0.333.g22e6ee6cdf