Skip to content

Commit e6d88ca

Browse files
committed
Merge branch 'jx/i18n-more-marking' into maint
* jx/i18n-more-marking: i18n: format_tracking_info "Your branch is behind" message i18n: git-commit whence_s "merge/cherry-pick" message
2 parents 68e4b55 + 8a5b749 commit e6d88ca

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

builtin/commit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ static void determine_whence(struct wt_status *s)
196196

197197
static const char *whence_s(void)
198198
{
199-
char *s = "";
199+
const char *s = "";
200200

201201
switch (whence) {
202202
case FROM_COMMIT:
203203
break;
204204
case FROM_MERGE:
205-
s = "merge";
205+
s = _("merge");
206206
break;
207207
case FROM_CHERRY_PICK:
208-
s = "cherry-pick";
208+
s = _("cherry-pick");
209209
break;
210210
}
211211

remote.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,19 +1572,29 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
15721572
base = branch->merge[0]->dst;
15731573
base = shorten_unambiguous_ref(base, 0);
15741574
if (!num_theirs)
1575-
strbuf_addf(sb, "Your branch is ahead of '%s' "
1576-
"by %d commit%s.\n",
1577-
base, num_ours, (num_ours == 1) ? "" : "s");
1575+
strbuf_addf(sb,
1576+
Q_("Your branch is ahead of '%s' by %d commit.\n",
1577+
"Your branch is ahead of '%s' by %d commits.\n",
1578+
num_ours),
1579+
base, num_ours);
15781580
else if (!num_ours)
1579-
strbuf_addf(sb, "Your branch is behind '%s' "
1580-
"by %d commit%s, "
1581-
"and can be fast-forwarded.\n",
1582-
base, num_theirs, (num_theirs == 1) ? "" : "s");
1581+
strbuf_addf(sb,
1582+
Q_("Your branch is behind '%s' by %d commit, "
1583+
"and can be fast-forwarded.\n",
1584+
"Your branch is behind '%s' by %d commits, "
1585+
"and can be fast-forwarded.\n",
1586+
num_theirs),
1587+
base, num_theirs);
15831588
else
1584-
strbuf_addf(sb, "Your branch and '%s' have diverged,\n"
1585-
"and have %d and %d different commit(s) each, "
1586-
"respectively.\n",
1587-
base, num_ours, num_theirs);
1589+
strbuf_addf(sb,
1590+
Q_("Your branch and '%s' have diverged,\n"
1591+
"and have %d and %d different commit each, "
1592+
"respectively.\n",
1593+
"Your branch and '%s' have diverged,\n"
1594+
"and have %d and %d different commits each, "
1595+
"respectively.\n",
1596+
num_theirs),
1597+
base, num_ours, num_theirs);
15881598
return 1;
15891599
}
15901600

0 commit comments

Comments
 (0)