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

Re: [Outreachy PATCH] delta-islands: use Q_() for island count

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2026, 18:00 UTC
Message-ID
<xmqqv775xyz9.fsf@gitster.g>
In-Reply-To
<20261013164922.93099-1-okhuomonajayi54@gmail.com>
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
Show 8 quoted lines
> The progress message "Marked %d islands, done." is marked for
> translation with _(), which gives translators a single form for
> every count. It reads wrongly when only one island is marked, and
> languages with more than two plural forms cannot translate it
> correctly.
>
> Use Q_() with a singular and a plural form so the right one is
> picked from island_counter.
Nicely written.
>
> Found with:
>
>     git grep '[^Q]_("[^"]*%[id]' -- '*.c'

I am not sure of the value in this, though. You certainly do not mean to say that you updated all of the ones that you found with the above. You are not inviting others to do the same grep and "fix" any of the hits, as the pattern gives too many false positives (i.e., not all %d are about number of things, like the line number a parser has found the error it is reporting at), and without warning that, it would not be helpful to these others.

Show 17 quoted lines
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
> ---
>  delta-islands.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/delta-islands.c b/delta-islands.c
> index e71a7e1c05..c1c0f992f5 100644
> --- a/delta-islands.c
> +++ b/delta-islands.c
> @@ -496,7 +496,9 @@ void load_delta_islands(struct repository *r, int progress)
>  	free_remote_islands(ild.remote_islands);
>  
>  	if (progress)
> -		fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
> +		fprintf(stderr, Q_("Marked %d island, done.\n",
> +				   "Marked %d islands, done.\n", island_counter),
> +			island_counter);
The change itself looks sensible to me.
Thanks.
Previous: Okhuomon AjayiNext: Okhuomon Ajayi
Message 3 of 8 in “[Outreachy] Introduction: Okhuomon Ajayi, microproject in delta-islands.c”
  1. Okhuomon AjayiOct 13, 2026
  2. delta-islands: use Q_() for island countOkhuomon Ajayi, Oct 13, 2026
  3. Junio C HamanoOct 13, 2026
  4. Okhuomon AjayiOct 13, 2026
  5. Junio C HamanoOct 13, 2026
  6. delta-islands: use Q_() for island countOkhuomon Ajayi, Oct 13, 2026
  7. Usman AkinyemiOct 13, 2026
  8. Okhuomon AjayiOct 13, 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.