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

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.
Previous: Dimitriy Ryazantcev
Message 2 of 2 in “l10n: localizable upload progress messages”
  1. l10n: localizable upload progress messagesDimitriy Ryazantcev, Jul 2, 2019
  2. Junio C HamanoJul 2, 2019

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.