Subject: Re: [PATCH v3 2/7] strbuf: split out logic to humanise byte values

From: Junio C Hamano <[email-masked]>
Date: Tue, 16 Dec 2025 10:19:38 +0900

Justin Tobler <[email-masked]> writes:

> +		*value = xstrfmt(_("%u"), (unsigned)bytes);

Does this "%u" need translation?

I very much doubt it, but if it did, this does need TRANSLATORS
comment.

> +		*unit = humanise_rate ?
> +			       /* TRANSLATORS: IEC 80000-13:2008 byte/second */
> +			       Q_("byte/s", "bytes/s", bytes) :
> +			       /* TRANSLATORS: IEC 80000-13:2008 byte */
> +			       Q_("byte", "bytes", bytes);
>  	}
>  }
>  
> +static void strbuf_humanise(struct strbuf *buf, off_t bytes, unsigned flags)
> +{
> +	char *value;
> +	const char *unit;
> +
> +	humanise_bytes(bytes, &value, &unit, flags);
> +	strbuf_addf(buf, _("%s %s"), value, unit);

This definitely needs the TRANSLATORS comment to tell what is going on.

> +	free(value);
> +}