Re: [PATCH 09/22] connect.c: mark more strings for translation

2018-06-03 Thread Eric Sunshine
On Sat, Jun 2, 2018 at 12:32 AM, Nguyễn Thái Ngọc Duy  wrote:
> There are also some rephrasing and breaking sentences to help
> translators.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy 
> ---
> diff --git a/connect.c b/connect.c
> @@ -921,7 +928,7 @@ static enum protocol parse_connect_url(const char 
> *url_orig, char **ret_host,
> if (!path || !*path)
> -   die("No path specified. See 'man git-pull' for valid url 
> syntax");
> +   die(_("no path specified. See 'man git-pull' for valid url 
> syntax"));

Perhaps:

no path specified; see 'man git-pull' for valid url syntax

?


[PATCH 09/22] connect.c: mark more strings for translation

2018-06-01 Thread Nguyễn Thái Ngọc Duy
There are also some rephrasing and breaking sentences to help
translators.

Signed-off-by: Nguyễn Thái Ngọc Duy 
---
 connect.c | 87 +++
 t/t5512-ls-remote.sh  |  2 +-
 t/t5570-git-daemon.sh |  6 +--
 3 files changed, 51 insertions(+), 44 deletions(-)

diff --git a/connect.c b/connect.c
index 968e91b18c..af8a581d0e 100644
--- a/connect.c
+++ b/connect.c
@@ -58,9 +58,9 @@ static NORETURN void die_initial_contact(int unexpected)
 * response does not necessarily mean an ACL problem, though.
 */
if (unexpected)
-   die(_("The remote end hung up upon initial contact"));
+   die(_("the remote end hung up upon initial contact"));
else
-   die(_("Could not read from remote repository.\n\n"
+   die(_("could not read from remote repository.\n\n"
  "Please make sure you have the correct access rights\n"
  "and the repository exists."));
 }
@@ -78,7 +78,7 @@ int server_supports_v2(const char *c, int die_on_error)
}
 
if (die_on_error)
-   die("server doesn't support '%s'", c);
+   die(_("server doesn't support '%s'"), c);
 
return 0;
 }
@@ -100,7 +100,7 @@ int server_supports_feature(const char *c, const char 
*feature,
}
 
if (die_on_error)
-   die("server doesn't support feature '%s'", feature);
+   die(_("server doesn't support feature '%s'"), feature);
 
return 0;
 }
@@ -111,7 +111,7 @@ static void process_capabilities_v2(struct packet_reader 
*reader)
argv_array_push(&server_capabilities_v2, reader->line);
 
if (reader->status != PACKET_READ_FLUSH)
-   die("expected flush after capabilities");
+   die(_("expected flush after capabilities"));
 }
 
 enum protocol_version discover_version(struct packet_reader *reader)
@@ -230,7 +230,7 @@ static int process_dummy_ref(const char *line)
 static void check_no_capabilities(const char *line, int len)
 {
if (strlen(line) != len)
-   warning("Ignoring capabilities after first line '%s'",
+   warning(_("ignoring capabilities after first line '%s'"),
line + strlen(line));
 }
 
@@ -249,7 +249,7 @@ static int process_ref(const char *line, int len, struct 
ref ***list,
if (extra_have && !strcmp(name, ".have")) {
oid_array_append(extra_have, &old_oid);
} else if (!strcmp(name, "capabilities^{}")) {
-   die("protocol error: unexpected capabilities^{}");
+   die(_("protocol error: unexpected capabilities^{}"));
} else if (check_ref(name, flags)) {
struct ref *ref = alloc_ref(name);
oidcpy(&ref->old_oid, &old_oid);
@@ -270,9 +270,9 @@ static int process_shallow(const char *line, int len,
return 0;
 
if (get_oid_hex(arg, &old_oid))
-   die("protocol error: expected shallow sha-1, got '%s'", arg);
+   die(_("protocol error: expected shallow sha-1, got '%s'"), arg);
if (!shallow_points)
-   die("repository on the other end cannot be shallow");
+   die(_("repository on the other end cannot be shallow"));
oid_array_append(shallow_points, &old_oid);
check_no_capabilities(line, len);
return 1;
@@ -307,13 +307,13 @@ struct ref **get_remote_heads(struct packet_reader 
*reader,
case PACKET_READ_NORMAL:
len = reader->pktlen;
if (len > 4 && skip_prefix(reader->line, "ERR ", &arg))
-   die("remote error: %s", arg);
+   die(_("remote error: %s"), arg);
break;
case PACKET_READ_FLUSH:
state = EXPECTING_DONE;
break;
case PACKET_READ_DELIM:
-   die("invalid packet");
+   die(_("invalid packet"));
}
 
switch (state) {
@@ -333,7 +333,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,
case EXPECTING_SHALLOW:
if (process_shallow(reader->line, len, shallow_points))
break;
-   die("protocol error: unexpected '%s'", reader->line);
+   die(_("protocol error: unexpected '%s'"), reader->line);
case EXPECTING_DONE:
break;
}
@@ -441,11 +441,11 @@ struct ref **get_remote_refs(int fd_out, struct 
packet_reader *reader,
/* Process response from server */
while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
if (!process_ref_v2(reader->line, &list))
-   die("invalid ls-refs response: %s", reader->line);
+   die