Re: [PATCH 12/12] fsck: mark strings for translation
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 29, 2018, 16:14 UTC
- Message-ID
- <CACsJy8CE2mi69kXcs2sFYm34txfDb24Qqm4bgv_w3WAcYEEFLg@mail.gmail.com>
- In-Reply-To
- <xmqqsh0o3kuw.fsf@gitster-ct.c.googlers.com>
On Mon, Oct 29, 2018 at 3:09 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>
> SZEDER Gábor <szeder.dev@gmail.com> writes:
>
> >> - fprintf(stderr, "%s in %s %s: %s\n",
> >> - msg_type, printable_type(obj), describe_object(obj), err);
> >> + fprintf_ln(stderr, _("%s in %s %s: %s"),
> >
> > Are the (f)printf() -> (f)printf_ln() changes all over
> > 'builtin/fsck.c' really necessary to mark strings for translation?
>
> It is beyond absolute minimum but I saw it argued here that this
> makes it easier to manage the .po and .pot files if your message
> strings do not end with LF, a you are much less likely to _add_
> unneeded LF to the translated string than _lose_ LF at the end of
> translated string.Especially when \n plays an important role and we don't trust translators to keep it [1] [2]. It's probably a too defensive stance and often does not apply, so nowadays I do it just to keep a consistent pattern in the code.
[1] https://public-inbox.org/git/20120308220131.GA10122@burratino/#t [2] but then translators can crash programs anyway (e.g. changing %d to %s...) we just trust gettext tools to catch problems early.
-- Duy