From: "Jordi Mas via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jordi Mas <jmas@softcatala.org>, Jordi Mas <jmas@softcatala.org>
Subject: [PATCH] l10n: allows to translate diff messages
Date: Tue, 13 Jul 2021 12:01:16 +0000 [thread overview]
Message-ID: <pull.1045.git.git.1626177676801.gitgitgadget@gmail.com> (raw)
From: Jordi Mas <jmas@softcatala.org>
Allows to translate the diff messages shown when the
user commits, indicating the number of insertions,
deletions and files changed.
Signed-off-by: Jordi Mas <jmas@softcatala.org>
---
Allow to translate diff message
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1045%2Fjordimas%2Flocalize-msg-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1045/jordimas/localize-msg-v1
Pull-Request: https://github.com/git/git/pull/1045
diff.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 52c791574b..29db9ce079 100644
--- a/diff.c
+++ b/diff.c
@@ -2593,7 +2593,7 @@ static void print_stat_summary_inserts_deletes(struct diff_options *options,
}
strbuf_addf(&sb,
- (files == 1) ? " %d file changed" : " %d files changed",
+ Q_(" %d file changed", " %d files changed", files),
files);
/*
@@ -2606,13 +2606,13 @@ static void print_stat_summary_inserts_deletes(struct diff_options *options,
*/
if (insertions || deletions == 0) {
strbuf_addf(&sb,
- (insertions == 1) ? ", %d insertion(+)" : ", %d insertions(+)",
+ Q_(", %d insertion(+)", ", %d insertions(+)", insertions),
insertions);
}
if (deletions || insertions == 0) {
strbuf_addf(&sb,
- (deletions == 1) ? ", %d deletion(-)" : ", %d deletions(-)",
+ Q_(", %d deletion(-)", ", %d deletions(-)", deletions),
deletions);
}
strbuf_addch(&sb, '\n');
base-commit: d486ca60a51c9cb1fe068803c3f540724e95e83a
--
gitgitgadget
next reply other threads:[~2021-07-13 12:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 12:01 Jordi Mas via GitGitGadget [this message]
2021-07-13 23:11 ` [PATCH] l10n: allows to translate diff messages Junio C Hamano
2021-07-14 0:09 ` Bagas Sanjaya
2021-07-14 0:18 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1045.git.git.1626177676801.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=jmas@softcatala.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).