git-branch: remove lego in i18n messages
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
10d4332e00
commit
c179837cfb
|
@ -152,21 +152,22 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
|
||||||
struct commit *rev, *head_rev = NULL;
|
struct commit *rev, *head_rev = NULL;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
const char *fmt, *remote;
|
const char *fmt;
|
||||||
int i;
|
int i;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int remote_branch = 0;
|
||||||
struct strbuf bname = STRBUF_INIT;
|
struct strbuf bname = STRBUF_INIT;
|
||||||
|
|
||||||
switch (kinds) {
|
switch (kinds) {
|
||||||
case REF_REMOTE_BRANCH:
|
case REF_REMOTE_BRANCH:
|
||||||
fmt = "refs/remotes/%s";
|
fmt = "refs/remotes/%s";
|
||||||
/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
|
/* For subsequent UI messages */
|
||||||
remote = _("remote ");
|
remote_branch = 1;
|
||||||
|
|
||||||
force = 1;
|
force = 1;
|
||||||
break;
|
break;
|
||||||
case REF_LOCAL_BRANCH:
|
case REF_LOCAL_BRANCH:
|
||||||
fmt = "refs/heads/%s";
|
fmt = "refs/heads/%s";
|
||||||
remote = "";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
die(_("cannot use -a with -d"));
|
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));
|
name = xstrdup(mkpath(fmt, bname.buf));
|
||||||
if (read_ref(name, sha1)) {
|
if (read_ref(name, sha1)) {
|
||||||
error(_("%sbranch '%s' not found."),
|
error(remote_branch
|
||||||
remote, bname.buf);
|
? _("remote branch '%s' not found.")
|
||||||
|
: _("branch '%s' not found."), bname.buf);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -212,14 +214,18 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delete_ref(name, sha1, 0)) {
|
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);
|
bname.buf);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else {
|
} else {
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
printf(_("Deleted %sbranch %s (was %s).\n"),
|
printf(remote_branch
|
||||||
remote, bname.buf,
|
? _("Deleted remote branch %s (was %s).\n")
|
||||||
|
: _("Deleted branch %s (was %s).\n"),
|
||||||
|
bname.buf,
|
||||||
find_unique_abbrev(sha1, DEFAULT_ABBREV));
|
find_unique_abbrev(sha1, DEFAULT_ABBREV));
|
||||||
strbuf_addf(&buf, "branch.%s", bname.buf);
|
strbuf_addf(&buf, "branch.%s", bname.buf);
|
||||||
if (git_config_rename_section(buf.buf, NULL) < 0)
|
if (git_config_rename_section(buf.buf, NULL) < 0)
|
||||||
|
|
Loading…
Reference in New Issue