Re: [PATCH v6] l10n: localizable upload progress messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dimitriy Ryazantcev <dimitriy.ryazantcev@xxxxxxxxx> writes:

> -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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux