From be39de2b262bfcd440ed81b4de33711eb8a37cf4 Mon Sep 17 00:00:00 2001 From: Jiang Xin Date: Thu, 2 Feb 2012 01:20:30 +0800 Subject: i18n: git-commit whence_s "merge/cherry-pick" message Mark the "merge/cherry-pick" messages in whence_s for translation. These messages returned from whence_s function are used as argument to build other messages. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano diff --git a/builtin/commit.c b/builtin/commit.c index eba1377..470b4a4 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -196,16 +196,16 @@ static void determine_whence(struct wt_status *s) static const char *whence_s(void) { - char *s = ""; + const char *s = ""; switch (whence) { case FROM_COMMIT: break; case FROM_MERGE: - s = "merge"; + s = _("merge"); break; case FROM_CHERRY_PICK: - s = "cherry-pick"; + s = _("cherry-pick"); break; } -- cgit v0.10.2-6-g49f6 From 8a5b749428d39a0e85fb0f76306b88945cb5c6e0 Mon Sep 17 00:00:00 2001 From: Jiang Xin Date: Thu, 2 Feb 2012 10:02:23 +0800 Subject: 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 Signed-off-by: Junio C Hamano diff --git a/remote.c b/remote.c index 73a3809..af597b3 100644 --- a/remote.c +++ b/remote.c @@ -1572,19 +1572,29 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb) base = branch->merge[0]->dst; base = shorten_unambiguous_ref(base, 0); if (!num_theirs) - strbuf_addf(sb, "Your branch is ahead of '%s' " - "by %d commit%s.\n", - base, num_ours, (num_ours == 1) ? "" : "s"); + strbuf_addf(sb, + Q_("Your branch is ahead of '%s' by %d commit.\n", + "Your branch is ahead of '%s' by %d commits.\n", + num_ours), + base, num_ours); else if (!num_ours) - strbuf_addf(sb, "Your branch is behind '%s' " - "by %d commit%s, " - "and can be fast-forwarded.\n", - base, num_theirs, (num_theirs == 1) ? "" : "s"); + strbuf_addf(sb, + Q_("Your branch is behind '%s' by %d commit, " + "and can be fast-forwarded.\n", + "Your branch is behind '%s' by %d commits, " + "and can be fast-forwarded.\n", + num_theirs), + base, num_theirs); else - strbuf_addf(sb, "Your branch and '%s' have diverged,\n" - "and have %d and %d different commit(s) each, " - "respectively.\n", - base, num_ours, num_theirs); + strbuf_addf(sb, + Q_("Your branch and '%s' have diverged,\n" + "and have %d and %d different commit each, " + "respectively.\n", + "Your branch and '%s' have diverged,\n" + "and have %d and %d different commits each, " + "respectively.\n", + num_theirs), + base, num_ours, num_theirs); return 1; } -- cgit v0.10.2-6-g49f6