From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 21/22] transport.c: mark strings for translating
Date: Sat, 27 Feb 2016 13:42:12 +0700 [thread overview]
Message-ID: <1456555333-5853-22-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1456555333-5853-1-git-send-email-pclouds@gmail.com>
More strings can be translated in print_ref_status() at least, but we
need to deal with utf-8 string length there. Let's stick with a safe
subset for now.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
transport.c | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/transport.c b/transport.c
index ca3cfa4..93be900 100644
--- a/transport.c
+++ b/transport.c
@@ -83,7 +83,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport, int for_pus
close(data->fd);
data->fd = read_bundle_header(transport->url, &data->header);
if (data->fd < 0)
- die ("Could not read bundle '%s'.", transport->url);
+ die(_("Could not read bundle '%s'."), transport->url);
for (i = 0; i < data->header.references.nr; i++) {
struct ref_list_entry *e = data->header.references.list + i;
struct ref *ref = alloc_ref(e->name);
@@ -148,7 +148,7 @@ static int set_git_option(struct git_transport_options *opts,
char *end;
opts->depth = strtol(value, &end, 0);
if (*end)
- die("transport: invalid depth option '%s'", value);
+ die(_("transport: invalid depth option '%s'"), value);
}
return 0;
}
@@ -285,7 +285,7 @@ void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int v
if (!remote_find_tracking(remote, &rs)) {
if (verbose)
- fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
+ fprintf_ln(stderr, _("updating local tracking ref '%s'"), rs.dst);
if (ref->deletion) {
delete_ref(rs.dst, NULL, 0);
} else
@@ -480,8 +480,8 @@ void transport_verify_remote_names(int nr_heads, const char **heads)
remote = remote ? (remote + 1) : local;
if (check_refname_format(remote,
REFNAME_ALLOW_ONELEVEL|REFNAME_REFSPEC_PATTERN))
- die("remote part of refspec is not a valid name in %s",
- heads[i]);
+ die(_("remote part of refspec is not a valid name in %s"),
+ heads[i]);
}
}
@@ -626,7 +626,7 @@ int is_transport_allowed(const char *type)
void transport_check_allowed(const char *type)
{
if (!is_transport_allowed(type))
- die("transport '%s' not allowed", type);
+ die(_("transport '%s' not allowed"), type);
}
int transport_restrict_protocols(void)
@@ -665,7 +665,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
if (helper) {
transport_helper_init(ret, helper);
} else if (starts_with(url, "rsync:")) {
- die("git-over-rsync is no longer supported");
+ die(_("git-over-rsync is no longer supported"));
} else if (url_is_local_not_ssh(url) && is_file(url) && is_bundle(url, 1)) {
struct bundle_transport_data *data = xcalloc(1, sizeof(*data));
transport_check_allowed("file");
@@ -766,19 +766,22 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
{
int i;
- fprintf(stderr, "The following submodule paths contain changes that can\n"
- "not be found on any remote:\n");
+ fprintf_ln(stderr, _("The following submodule paths contain changes that can\n"
+ "not be found on any remote:"));
for (i = 0; i < needs_pushing->nr; i++)
printf(" %s\n", needs_pushing->items[i].string);
- fprintf(stderr, "\nPlease try\n\n"
- " git push --recurse-submodules=on-demand\n\n"
- "or cd to the path and use\n\n"
- " git push\n\n"
- "to push them to a remote.\n\n");
+ fputc('\n', stderr);
+ fprintf_ln(stderr,
+ _("Please try\n\n"
+ " git push --recurse-submodules=on-demand\n\n"
+ "or cd to the path and use\n\n"
+ " git push\n\n"
+ "to push them to a remote."));
+ fprintf(stderr, "\n\n");
string_list_clear(needs_pushing, 0);
- die("Aborting.");
+ die(_("Aborting."));
}
static int run_pre_push_hook(struct transport *transport,
@@ -853,7 +856,7 @@ int transport_push(struct transport *transport,
if (transport->push) {
/* Maybe FIXME. But no important transport uses this case. */
if (flags & TRANSPORT_PUSH_SET_UPSTREAM)
- die("This transport does not support using --set-upstream");
+ die(_("This transport does not support using --set-upstream"));
return transport->push(transport, refspec_nr, refspec, flags);
} else if (transport->push_refs) {
@@ -905,7 +908,7 @@ int transport_push(struct transport *transport,
if (!is_null_oid(&ref->new_oid) &&
!push_unpushed_submodules(ref->new_oid.hash,
transport->remote->name))
- die ("Failed to push all needed submodules!");
+ die(_("Failed to push all needed submodules!"));
}
if ((flags & (TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND |
@@ -941,7 +944,7 @@ int transport_push(struct transport *transport,
if (porcelain && !push_ret)
puts("Done");
else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
- fprintf(stderr, "Everything up-to-date\n");
+ fprintf_ln(stderr, _("Everything up-to-date"));
return ret;
}
@@ -1009,7 +1012,7 @@ int transport_connect(struct transport *transport, const char *name,
if (transport->connect)
return transport->connect(transport, name, exec, fd);
else
- die("Operation not supported by protocol");
+ die(_("Operation not supported by protocol"));
}
int transport_disconnect(struct transport *transport)
--
2.8.0.rc0.205.g7ec8cf1
next prev parent reply other threads:[~2016-02-27 6:44 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 01/22] credential-cache--daemon: enable localized messages Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-28 18:57 ` Junio C Hamano
2016-02-29 0:33 ` Duy Nguyen
2016-02-29 18:22 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 03/22] builtin/checkout.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:00 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 04/22] builtin/clone.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:05 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 05/22] builtin/config.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:25 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 06/22] " Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 07/22] builtin/update-index.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:27 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 08/22] convert.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:29 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 09/22] credential-cache--daemon.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:30 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 10/22] http.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:31 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 11/22] ident.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:34 ` Junio C Hamano
2016-03-01 14:56 ` Jeff King
2016-02-27 6:42 ` [PATCH 12/22] notes.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:36 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 13/22] ref-filter.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:41 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 14/22] refs/files-backend.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:43 ` Junio C Hamano
2016-03-01 10:40 ` Duy Nguyen
2016-02-27 6:42 ` [PATCH 15/22] remote-curl.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:50 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 16/22] run-command.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:52 ` Junio C Hamano
2016-03-01 0:00 ` Stefan Beller
2016-02-27 6:42 ` [PATCH 17/22] sha1_file.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 18/22] submodule.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 19/22] trailer.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:55 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 20/22] transport-helper.c: mark strings for translating Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` Nguyễn Thái Ngọc Duy [this message]
2016-02-27 6:42 ` [PATCH 22/22] wrapper.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 17:34 ` [PATCH 00/22] Mark more " Junio C Hamano
2016-02-27 19:00 ` Junio C Hamano
2016-02-28 0:43 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456555333-5853-22-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).