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

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

 



Dimitriy <dimitriy.ryazantcev@xxxxxxxxx> writes:

> Seems it can extract plural forms only from Q_ (ngettext() call) and
> cannot from _N (gettext_noop() call) in current configuration[0].
> Maybe in this case we can try to forward already translated string
> to strbuf_humanise():
>
> static void strbuf_humanise(struct strbuf *buf, off_t bytes, struct
> human_format *fmt)
> {
> ....
>         } else {
>                 strbuf_addf(buf, fmt->byte, (unsigned)bytes);
> ....
> }
>
> void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes)
> {
>         struct human_format bytes_fmt = {
>                 .giga = _("%u.%2.2u GiB"),
>                 .mega = _("%u.%2.2u MiB"),
>                 .kilo = _("%u.%2.2u KiB"),
>                 .byte = Q_("%u byte", "%u bytes", (unsigned)bytes),
>         };
>         strbuf_humanise(buf, bytes, &bytes_fmt);
> }
>
> What do you think?

Well, I was trying to avoid making Q_() call when we did not have
to, but if we are running with gettext, we cannot avoid calling Q_()
every time this helper is called, as .byte field has to depend on
the value of bytes, so...





[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