Re: [PATCH v2 01/11] i18n: add--interactive: mark strings for translation
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Sep 28, 2016, 14:29 UTC
- Message-ID
- <CACsJy8BUaJ8sRw2EtgrTe0X4khCsuKFD75ON12oC1FvqdMXr=g@mail.gmail.com>
- In-Reply-To
- <1475066620.3257.12.camel@sapo.pt>
On Wed, Sep 28, 2016 at 7:43 PM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:
Show 18 quoted lines
> A Dom, 25-09-2016 às 15:52 -0700, Junio C Hamano escreveu:
>> > @@ -252,7 +253,7 @@ sub list_untracked {
>> > }
>> >
>> > my $status_fmt = '%12s %12s %s';
>> > -my $status_head = sprintf($status_fmt, 'staged', 'unstaged', 'path');
>> > +my $status_head = sprintf($status_fmt, __('staged'), __('unstaged'), __('path'));
>>
>> Wouldn't it make sense to allow translators to tweak $status_fmt if
>> you are allowing the earlier elements that are formatted with %12s,
>> as their translation may not fit within that width, in which case
>> they may want to make these columns wider?
>
> As far as I understand, %12s means that the argument printed will have
> a minimum length of 12 columns. So if the translation of 'stage' is
> longer than 12 it will be printed fully no matter what. Though in that
> case, the header will not be align correctly anymore:
> for other instances of this in the present patch series.It's 12 bytes, not columns (unless perl understands input string's encoding, which I doubt). Think about multi-byte encodings like utf-8, where three letters (or "columns") do not necessary mean three bytes. The result is most likely unaligned in that case.
-- Duy