Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c179837

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 10d4332 commit c179837

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

builtin/branch.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,22 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
152152
struct commit *rev, *head_rev = NULL;
153153
unsigned char sha1[20];
154154
char *name = NULL;
155-
const char *fmt, *remote;
155+
const char *fmt;
156156
int i;
157157
int ret = 0;
158+
int remote_branch = 0;
158159
struct strbuf bname = STRBUF_INIT;
159160

160161
switch (kinds) {
161162
case REF_REMOTE_BRANCH:
162163
fmt = "refs/remotes/%s";
163-
/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
164-
remote = _("remote ");
164+
/* For subsequent UI messages */
165+
remote_branch = 1;
166+
165167
force = 1;
166168
break;
167169
case REF_LOCAL_BRANCH:
168170
fmt = "refs/heads/%s";
169-
remote = "";
170171
break;
171172
default:
172173
die(_("cannot use -a with -d"));
@@ -190,8 +191,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
190191

191192
name = xstrdup(mkpath(fmt, bname.buf));
192193
if (read_ref(name, sha1)) {
193-
error(_("%sbranch '%s' not found."),
194-
remote, bname.buf);
194+
error(remote_branch
195+
? _("remote branch '%s' not found.")
196+
: _("branch '%s' not found."), bname.buf);
195197
ret = 1;
196198
continue;
197199
}
@@ -212,14 +214,18 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
212214
}
213215

214216
if (delete_ref(name, sha1, 0)) {
215-
error(_("Error deleting %sbranch '%s'"), remote,
217+
error(remote_branch
218+
? _("Error deleting remote branch '%s'")
219+
: _("Error deleting branch '%s'"),
216220
bname.buf);
217221
ret = 1;
218222
} else {
219223
struct strbuf buf = STRBUF_INIT;
220224
if (!quiet)
221-
printf(_("Deleted %sbranch %s (was %s).\n"),
222-
remote, bname.buf,
225+
printf(remote_branch
226+
? _("Deleted remote branch %s (was %s).\n")
227+
: _("Deleted branch %s (was %s).\n"),
228+
bname.buf,
223229
find_unique_abbrev(sha1, DEFAULT_ABBREV));
224230
strbuf_addf(&buf, "branch.%s", bname.buf);
225231
if (git_config_rename_section(buf.buf, NULL) < 0)

0 commit comments

Comments
 (0)