Web lists-archives.com

Re: [PATCH 12/12] fsck: mark strings for translation


Ævar Arnfjörð Bjarmason wrote:
>> On Mon, Oct 29, 2018 at 3:09 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>> SZEDER Gábor <szeder.dev@xxxxxxxxx> writes:
>>>> Nguyễn Thái Ngọc Duy wrote:

>>>>> -    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.
> As Jonathan pointed out in the follow-up message[1] this sort of thing
> is checked for in msgfmt, so sure, let's strip the \n, but it's really
> not something we need to worry about. Likewise with translators turning
> "%s" into "%d" (or "% s") or whatever.

IMHO the advantage of leaving the \n out in the message is not so much
that we don't trust translators but more that where we can make their
lives easier, we should.

In other words, I'm glad the patch does that, and Ævar, I agree.

Thanks, both.


> 1. https://public-inbox.org/git/CACsJy8AcUy9FZiiehGc7mEL4i+XP6u0pmH1rGoR-WZnhYT1UMQ@xxxxxxxxxxxxxx/