# [GSoC PATCH] add-patch: use Q_() for split hunk translation

1 messages from 2026-11-10 to 2026-11-10. Participants: aeron-gh.
Thread: https://gitlist.dev/t/66824

## aeron-gh, 2026-11-10 19:38

Subject: [GSoC PATCH] add-patch: use Q_() for split hunk translation
Message-ID: <20261110193804.76958-1-agab0323@gmail.com>
URL: https://gitlist.dev/e/20261110193804.76958-1-agab0323%40gmail.com

```
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



```
