Re: [PATCH 25/25] gettextize: git-status shortstatus messages
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 2, 2010, 20:34 UTC
- Message-ID
- <AANLkTikALp-JtWSnvG2qvQ3h06AZpXg1DOnMs9Pp6EoO@mail.gmail.com>
- In-Reply-To
- <20100902202537.GC2531@burratino>
On Thu, Sep 2, 2010 at 20:25, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 24 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>> --- a/wt-status.c
>> +++ b/wt-status.c
>> @@ -814,15 +814,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
> [...]
>> } else {
>> - color_fprintf(s->fp, header_color, "ahead ");
>> + color_fprintf(s->fp, header_color, _("ahead "));
>> color_fprintf(s->fp, branch_color_local, "%d", num_ours);
>> - color_fprintf(s->fp, header_color, ", behind ");
>> + color_fprintf(s->fp, header_color, _(", behind "));
>> color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
>
> What we make those translators suffer through. :) Would it be possible to
> (eventually) introduce an interface vaguely like
>
> color_fprintf2(s->fp, "%C(ahead )%C(%d)%C(, behind )%C( %d)",
> header_color,
> branch_color_local, num_ours,
> header_color,
> branch_color_remote, num_theirs);
>
> ? I guess this would require using strbuf_expand instead of vsnprintf
> for %d et al.Yeah, that's my eventual master plan. This color_printf() interface really needs something like that so we can reasonably translate git-status et al.
Aside from gettext that'd make using color_fprintf() much nicer. Assembling messages like this bit-by-bit is really hard to follow.