Commit 48dbcbf2 authored by Peter Eisentraut's avatar Peter Eisentraut

pg_rewing pg_upgrade: Fix translation markers

In pg_log_v(), we need to translate the fmt before processing, not the
formatted message afterwards.
parent a5954de1
......@@ -34,26 +34,26 @@ pg_log_v(eLogType type, const char *fmt, va_list ap)
{
char message[QUERY_ALLOC];
vsnprintf(message, sizeof(message), fmt, ap);
vsnprintf(message, sizeof(message), _(fmt), ap);
switch (type)
{
case PG_DEBUG:
if (debug)
printf("%s", _(message));
printf("%s", message);
break;
case PG_PROGRESS:
if (showprogress)
printf("%s", _(message));
printf("%s", message);
break;
case PG_WARNING:
printf("%s", _(message));
printf("%s", message);
break;
case PG_FATAL:
printf("\n%s", _(message));
printf("\n%s", message);
printf("%s", _("Failure, exiting\n"));
exit(1);
break;
......
......@@ -89,7 +89,7 @@ pg_log_v(eLogType type, const char *fmt, va_list ap)
{
char message[QUERY_ALLOC];
vsnprintf(message, sizeof(message), fmt, ap);
vsnprintf(message, sizeof(message), _(fmt), ap);
/* PG_VERBOSE and PG_STATUS are only output in verbose mode */
/* fopen() on log_opts.internal might have failed, so check it */
......@@ -108,7 +108,7 @@ pg_log_v(eLogType type, const char *fmt, va_list ap)
{
case PG_VERBOSE:
if (log_opts.verbose)
printf("%s", _(message));
printf("%s", message);
break;
case PG_STATUS:
......@@ -123,16 +123,16 @@ pg_log_v(eLogType type, const char *fmt, va_list ap)
strlen(message) <= MESSAGE_WIDTH - 2 ? message :
message + strlen(message) - MESSAGE_WIDTH + 3 + 2);
else
printf(" %s\n", _(message));
printf(" %s\n", message);
break;
case PG_REPORT:
case PG_WARNING:
printf("%s", _(message));
printf("%s", message);
break;
case PG_FATAL:
printf("\n%s", _(message));
printf("\n%s", message);
printf("Failure, exiting\n");
exit(1);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment