git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Aaeron-gh <agab0323@gmail.com>
Date
Nov 10, 2026, 19:38 UTC
Message-ID
<20261110193804.76958-1-agab0323@gmail.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
Message 1 of 1 in “add-patch: use Q_() for split hunk translation”
  1. add-patch: use Q_() for split hunk translationaeron-gh, Nov 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.