From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio Hamano" <gitster@pobox.com>,
"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 3/5] git-branch: remove lego in i18n messages
Date: Mon, 30 Apr 2012 15:33:12 +0000 [thread overview]
Message-ID: <1335799995-7667-4-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1335799995-7667-1-git-send-email-avarab@gmail.com>
Instead of making translators translate "remote " and then using
"%sbranch" where "%s" is either "remote " or "" just split the two up
into separate messages. This makes the translation of this section of
git-branch much less confusing.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
builtin/branch.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index 5f150b4..8813d2e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -152,21 +152,22 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
struct commit *rev, *head_rev = NULL;
unsigned char sha1[20];
char *name = NULL;
- const char *fmt, *remote;
+ const char *fmt;
int i;
int ret = 0;
+ int remote_branch = 0;
struct strbuf bname = STRBUF_INIT;
switch (kinds) {
case REF_REMOTE_BRANCH:
fmt = "refs/remotes/%s";
- /* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
- remote = _("remote ");
+ /* For subsequent UI messages */
+ remote_branch = 1;
+
force = 1;
break;
case REF_LOCAL_BRANCH:
fmt = "refs/heads/%s";
- remote = "";
break;
default:
die(_("cannot use -a with -d"));
@@ -190,8 +191,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
name = xstrdup(mkpath(fmt, bname.buf));
if (read_ref(name, sha1)) {
- error(_("%sbranch '%s' not found."),
- remote, bname.buf);
+ error(remote_branch
+ ? _("remote branch '%s' not found.")
+ : _("branch '%s' not found."), bname.buf);
ret = 1;
continue;
}
@@ -212,14 +214,18 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
}
if (delete_ref(name, sha1, 0)) {
- error(_("Error deleting %sbranch '%s'"), remote,
+ error(remote_branch
+ ? _("Error deleting remote branch '%s'")
+ : _("Error deleting branch '%s'"),
bname.buf);
ret = 1;
} else {
struct strbuf buf = STRBUF_INIT;
if (!quiet)
- printf(_("Deleted %sbranch %s (was %s).\n"),
- remote, bname.buf,
+ printf(remote_branch
+ ? _("Deleted remote branch %s (was %s).\n")
+ : _("Deleted branch %s (was %s).\n"),
+ bname.buf,
find_unique_abbrev(sha1, DEFAULT_ABBREV));
strbuf_addf(&buf, "branch.%s", bname.buf);
if (git_config_rename_section(buf.buf, NULL) < 0)
--
1.7.10.546.gbaa1a.dirty
next prev parent reply other threads:[~2012-04-30 15:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
2012-04-30 17:30 ` Junio C Hamano
2012-04-30 17:54 ` Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 2/5] i18n: Add more TRANSLATORS comments Ævar Arnfjörð Bjarmason
2012-04-30 17:37 ` Junio C Hamano
2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason [this message]
2012-04-30 17:38 ` [PATCH 3/5] git-branch: remove lego in i18n messages Junio C Hamano
2012-04-30 15:33 ` [PATCH 4/5] git-commit: " Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 5/5] " Ævar Arnfjörð Bjarmason
2012-04-30 17:54 ` Junio C Hamano
2012-04-30 15:34 ` [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335799995-7667-4-git-send-email-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.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.
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 NNTP newsgroup(s).