Re: add more NLS to bin - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: add more NLS to bin
Date
Msg-id 4bec41c2-4d7b-677e-6f13-ac54d2fdfb1f@2ndquadrant.com
Whole thread Raw
In response to Re: add more NLS to bin  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 11/5/16 8:03 AM, Michael Paquier wrote:
>> > Yeah that was wrong anyway.  The previously existing translation markers
>> > were wrong.  We want to translate the fmt, not the formatted message.
> Does using one way or the other actually change something? Because
> pg_rewind/logging.c is not marking fmt but the message, the opposite
> of your v2 patch. One way or the other, having consistency for both
> would be nice.

Consider the following for example:
   pg_log(PG_DEBUG, "fetched file \"%s\", length %d\n", filename, len);

If you pass fmt to gettext(), then it will look up the string that you
see in the code.  If you pass the formatted message to gettext(), then
it will look up something like
   "fetched file \"foo\", length 12\n"

which it will not find, unless you provide translations for all
combinations of file names and lengths.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Remove the comment on the countereffectiveness of large shared_buffers on Windows
Next
From: Magnus Hagander
Date:
Subject: Re: Streaming basebackups vs pg_stat_tmp