Re: pg_rewind and log messages - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_rewind and log messages
Date
Msg-id CAB7nPqRGv2z7LKXZ8p+qyrSB5bL3Y0Oj9-81tDA6dwzAQChnSw@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind and log messages  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Tue, Apr 7, 2015 at 4:16 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> On Mon, Apr 6, 2015 at 10:01 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> Fujii Masao wrote:
>>> On Mon, Apr 6, 2015 at 5:33 PM, Michael Paquier
>>> <michael.paquier@gmail.com> wrote:
>>> > On Mon, Apr 6, 2015 at 1:41 PM, Michael Paquier wrote:
>>> >> I guess that you are working on a patch? If not, you are looking for one?
>>> >
>>> > Code-speaking, this gives the patch attached.
>>>
>>> Thanks! Here are the review comments:
>>>
>>> I'm not familiar with native language support (sorry), but don't we need to
>>> add the shortcut of gettext into every calls of pg_log and pg_fatal, e.g.,
>>> change pg_fatal("xxx") to pg_fatal(_("xxx"))? I know that fprintf() in
>>> pg_Log_v() has such shortcut, but I'm not sure if that's enough or not.
>>
>> It's not necessary for pg_fatal and the like, because those functions
>> are marked to have their first argument automatically translated in
>> nls.mk.  This means that the string literal is automatically extracted
>> into pg_rewind.pot for translators.  Of course, the function itself must
>> call _() (or some variant thereof) to actually fetch the translated
>> string at run time.
>
> Understood. Thanks!
>
> BTW, as far as I read pg_rewind's nls.mk correctly, it also has two problems.
>
> (1) file_ops.c should be added into GETTEXT_FILES.

And ../../common/restricted_tokens.c.

> (2) pg_log should be pg_log:2 in GETTEXT_TRIGGERS

Seems so.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: pg_rewind and log messages
Next
From: Michael Paquier
Date:
Subject: Re: pg_rewind and log messages