Skip to content

Commit 8a5b749

Browse files
jiangxingitster
authored andcommitted
i18n: format_tracking_info "Your branch is behind" message
Function format_tracking_info in remote.c is called by wt_status_print_tracking in wt-status.c, which will print branch tracking message in git-status. git-checkout also show these messages through it's report_tracking function. Signed-off-by: Jiang Xin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent be39de2 commit 8a5b749

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

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)