Re: [PATCH v6] l10n: localizable upload progress messages
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 2, 2019, 19:30 UTC
- Message-ID
- <xmqqsgro2q0q.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190702182248.5322-2-dimitriy.ryazantcev@gmail.com>
Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com> writes:
Show 14 quoted lines
> -void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes)
> +static void strbuf_humanise(struct strbuf *buf, off_t bytes,
> + int humanise_rate)
> {
> if (bytes > 1 << 30) {
> - strbuf_addf(buf, "%u.%2.2u GiB",
> + strbuf_addf(buf,
> + humanise_rate == 0 ?
> + /* TRANSLATORS: IEC 80000-13:2008 gibibyte */
> + _("%u.%2.2u GiB") :
> + /* TRANSLATORS: IEC 80000-13:2008 gibibyte/second */
> + _("%u.%2.2u GiB/s"),
> (unsigned)(bytes >> 30),
> (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);Thanks. I guess that the previous attempt to make it more table driven was probably a bit overkill, and because it did not quite work well for Q_(), this would probably be the "good enough, let's move on" optimal solution ;-)
Will queue.