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);
}


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to