Re: [PATCH v3 2/7] strbuf: split out logic to humanise byte values
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Dec 16, 2025, 01:36 UTC
- Message-ID
- <lftfcdnv7cn6ajrkjiim3z2ympvlfmlvtfco3x2wwpknytorif@3uutxricxy5d>
- In-Reply-To
- <xmqqms3j5il1.fsf@gitster.g>
On 25/12/16 10:19AM, Junio C Hamano wrote:
Show 8 quoted lines
> Justin Tobler <jltobler@gmail.com> 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.Ya, I don't think one should be necessary. Will remove in the next version.
I think I made the same mistake in humanise_count() in a later patch. I'll also adjust it there.
Show 18 quoted lines
>
> > + *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.Ok, will do in the next version. Thanks :)
-Justin