Git development
 help / color / mirror / Atom feed
From: aeron-gh <agab0323@gmail.com>
To: git@vger.kernel.org
Cc: aeron-gh <agab0323@gmail.com>, "Rubén Justo" <rjusto@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Patrick Steinhardt" <ps@pks.im>
Subject: [GSoC PATCH] add-patch: use Q_() for split hunk translation
Date: Wed, 11 Nov 2026 01:08:03 +0530	[thread overview]
Message-ID: <20261110193804.76958-1-agab0323@gmail.com> (raw)

The "Split into %d hunks." message uses _(), which provides
the same translation for every number. The Polish translation
shows "2 skrawków", but the correct form is "2 skrawki".
Numbers 2 and 5 need different plural forms.

Use Q_() with singular and plural forms, passing
splittable_into as the count. This lets translators provide
the correct plural forms while keeping the English output
unchanged.

Signed-off-by: aeron-gh <agab0323@gmail.com>
---
This patch is part of my GSoC 2027 microproject. Mahmoud
announced this issue in March, but no patch followed:
https://lore.kernel.org/git/CAC5WPUdYxm-7Pjq4oAddLKXjSa7B0YdK8ashyeR9vhCQt+wvPA@mail.gmail.com/

 add-patch.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/add-patch.c b/add-patch.c
index f27edcbe8d..4e75e2ceda 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -1942,7 +1942,9 @@ static size_t patch_update_file(struct add_p_state *s,
 			} else if (!split_hunk(s, file_diff,
 					     hunk - file_diff->hunk)) {
 				color_fprintf_ln(stdout, s->cfg.header_color,
-						 _("Split into %d hunks."),
+						 Q_("Split into %d hunk.",
+						    "Split into %d hunks.",
+						    splittable_into),
 						 (int)splittable_into);
 				rendered_hunk_index = -1;
 			}
-- 
2.56.0


                 reply	other threads:[~2026-11-10 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110193804.76958-1-agab0323@gmail.com \
    --to=agab0323@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    --cc=rjusto@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox