* [Outreachy PATCH] checkout: use Q_() for the "... and %d more" message
@ 2026-10-21 2:21 Tanga Joris
0 siblings, 0 replies; only message in thread
From: Tanga Joris @ 2026-10-21 2:21 UTC (permalink / raw)
To: git; +Cc: christian.couder, siddharthasthana31, Tanga Joris
When leaving orphaned commits behind, "git checkout" ends the list
with " ... and %d more." using a plain _(), so translators are unable
to give the correct plural form of the count. Use Q_() so gettext can
pick it. English string output stays the same.
Signed-off-by: Tanga Joris <tangajoris@gmail.com>
---
The count here is always 2 or more, because when only one commit is
left over, the suggest_reattach() function lists it instead of printing
this message. I still used Q_() because some languages, like Polish,
use different words for 2-4 and for 5 or more.
builtin/checkout.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2d575a4f57..49239f029f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1085,7 +1085,9 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
if (more == 1)
describe_one_orphan(&sb, last);
else
- strbuf_addf(&sb, _(" ... and %d more.\n"), more);
+ strbuf_addf(&sb, Q_(" ... and %d more.\n",
+ " ... and %d more.\n",
+ more), more);
}
fprintf(stderr,
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-21 2:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 2:21 [Outreachy PATCH] checkout: use Q_() for the "... and %d more" message Tanga Joris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox