From 8de770b7bee7fa446a8176416d8887ab54ce096a Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Mon, 10 Jun 2019 13:38:48 +0900 Subject: [PATCH] Change format of prep status of pg_upgrade The current format in prep_status() hinders messages from being translated since we don't have a general and reliable means to acquire actual display width of a non-ascii string. To make translation available, just do append " ... " to it instad of trying to align strings to fixed position. --- src/bin/pg_upgrade/util.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bin/pg_upgrade/util.c b/src/bin/pg_upgrade/util.c index d867995cc3..2807cacb87 100644 --- a/src/bin/pg_upgrade/util.c +++ b/src/bin/pg_upgrade/util.c @@ -73,14 +73,10 @@ prep_status(const char *fmt,...) char message[MAX_STRING]; va_start(args, fmt); - vsnprintf(message, sizeof(message), fmt, args); + vsnprintf(message, sizeof(message), _(fmt), args); va_end(args); - if (strlen(message) > 0 && message[strlen(message) - 1] == '\n') - pg_log(PG_REPORT, "%s", message); - else - /* trim strings that don't end in a newline */ - pg_log(PG_REPORT, "%-*s", MESSAGE_WIDTH, message); + pg_log(PG_REPORT, "%s ... ", message); } -- 2.16.3