some missing internationalization in pg_basebackup

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: some missing internationalization in pg_basebackup
Date: 2011-08-09 11:38:11
Message-ID: 1312889891.24721.27.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed that the progress reporting code in pg_basebackup does not
allow for translation. This would normally be easy to fix, but this
code has a number of tricky issues, including the INT64_FORMAT, possibly
some plural concerns, and some space alignment issues that hidden in
some of those hardcoded numbers.

I'm just posting it here as an open item in case someone has some ideas
in the meantime.

static void
progress_report(int tablespacenum, char *fn)
{
int percent = (int) ((totaldone / 1024) * 100 / totalsize);

if (percent > 100)
percent = 100;

if (verbose)
{
if (!fn)

/*
* No filename given, so clear the status line (used for last
* call)
*/
fprintf(stderr,
INT64_FORMAT "/" INT64_FORMAT " kB (100%%) %d/%d tablespaces %35s\r",
totaldone / 1024, totalsize,
tablespacenum, tablespacecount, "");
else
fprintf(stderr,
INT64_FORMAT "/" INT64_FORMAT " kB (%d%%) %d/%d tablespaces (%-30.30s)\r",
totaldone / 1024, totalsize,
percent,
tablespacenum, tablespacecount, fn);
}
else
fprintf(stderr, INT64_FORMAT "/" INT64_FORMAT " kB (%d%%) %d/%d tablespaces\r",
totaldone / 1024, totalsize,
percent,
tablespacenum, tablespacecount);
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-08-09 12:32:43 Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
Previous Message Shigeru Hanada 2011-08-09 10:28:53 Re: per-column FDW options, v5