From 1a07e59c3e269418f3f5d186d166bf5ab5db6667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 21 Jul 2018 09:49:19 +0200 Subject: Update messages in preparation for i18n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many messages will be marked for translation in the following commits. This commit updates some of them to be more consistent and reduce diff noise in those commits. Changes are - keep the first letter of die(), error() and warning() in lowercase - no full stop in die(), error() or warning() if it's single sentence messages - indentation - some messages are turned to BUG(), or prefixed with "BUG:" and will not be marked for i18n - some messages are improved to give more information - some messages are broken down by sentence to be i18n friendly (on the same token, combine multiple warning() into one big string) - the trailing \n is converted to printf_ln if possible, or deleted if not redundant - errno_errno() is used instead of explicit strerror() Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- archive-zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archive-zip.c') diff --git a/archive-zip.c b/archive-zip.c index 74f3fe9103..48d843489c 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -309,7 +309,7 @@ static int write_zip_entry(struct archiver_args *args, if (is_utf8(path)) flags |= ZIP_UTF8; else - warning("Path is not valid UTF-8: %s", path); + warning("path is not valid UTF-8: %s", path); } if (pathlen > 0xffff) { -- cgit v1.2.3 From 02f3fe5a9a7ba89223df2ebd8661aa8fa7102be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 21 Jul 2018 09:49:21 +0200 Subject: archive-zip.c: mark more strings for translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- archive-zip.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'archive-zip.c') diff --git a/archive-zip.c b/archive-zip.c index 48d843489c..7ad46d8854 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -309,11 +309,11 @@ static int write_zip_entry(struct archiver_args *args, if (is_utf8(path)) flags |= ZIP_UTF8; else - warning("path is not valid UTF-8: %s", path); + warning(_("path is not valid UTF-8: %s"), path); } if (pathlen > 0xffff) { - return error("path too long (%d chars, SHA1: %s): %s", + return error(_("path too long (%d chars, SHA1: %s): %s"), (int)pathlen, oid_to_hex(oid), path); } @@ -340,7 +340,7 @@ static int write_zip_entry(struct archiver_args *args, size > big_file_threshold) { stream = open_istream(oid, &type, &size, NULL); if (!stream) - return error("cannot stream blob %s", + return error(_("cannot stream blob %s"), oid_to_hex(oid)); flags |= ZIP_STREAM; out = buffer = NULL; @@ -348,7 +348,7 @@ static int write_zip_entry(struct archiver_args *args, buffer = object_file_to_archive(args, path, oid, mode, &type, &size); if (!buffer) - return error("cannot read %s", + return error(_("cannot read %s"), oid_to_hex(oid)); crc = crc32(crc, buffer, size); is_binary = entry_is_binary(path_without_prefix, @@ -357,7 +357,7 @@ static int write_zip_entry(struct archiver_args *args, } compressed_size = (method == 0) ? size : 0; } else { - return error("unsupported file mode: 0%o (SHA1: %s)", mode, + return error(_("unsupported file mode: 0%o (SHA1: %s)"), mode, oid_to_hex(oid)); } @@ -466,7 +466,7 @@ static int write_zip_entry(struct archiver_args *args, zstream.avail_in = readlen; result = git_deflate(&zstream, 0); if (result != Z_OK) - die("deflate error (%d)", result); + die(_("deflate error (%d)"), result); out_len = zstream.next_out - compressed; if (out_len > 0) { @@ -601,7 +601,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time) struct tm *t; if (date_overflows(*timestamp)) - die("timestamp too large for this system: %"PRItime, + die(_("timestamp too large for this system: %"PRItime), *timestamp); time = (time_t)*timestamp; t = localtime(&time); -- cgit v1.2.3