Commit e86ac70d authored by Peter Eisentraut's avatar Peter Eisentraut

Message translatability fixes

parent d22e9d53
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
#define XLOG_BLCKSZ_K (XLOG_BLCKSZ / 1024) #define XLOG_BLCKSZ_K (XLOG_BLCKSZ / 1024)
#define LABEL_FORMAT " %-30s" #define LABEL_FORMAT " %-30s"
#define NA_FORMAT "%20s" #define NA_FORMAT "%21s\n"
#define OPS_FORMAT "%13.3f ops/sec %6.0f usecs/op" /* translator: maintain alignment with NA_FORMAT */
#define OPS_FORMAT gettext_noop("%13.3f ops/sec %6.0f usecs/op\n")
#define USECS_SEC 1000000 #define USECS_SEC 1000000
/* These are macros to avoid timing the function call overhead. */ /* These are macros to avoid timing the function call overhead. */
...@@ -45,7 +46,7 @@ do { \ ...@@ -45,7 +46,7 @@ do { \
if (CreateThread(NULL, 0, process_alarm, NULL, 0, NULL) == \ if (CreateThread(NULL, 0, process_alarm, NULL, 0, NULL) == \
INVALID_HANDLE_VALUE) \ INVALID_HANDLE_VALUE) \
{ \ { \
fprintf(stderr, _("Cannot create thread for alarm\n")); \ fprintf(stderr, _("Could not create thread for alarm\n")); \
exit(1); \ exit(1); \
} \ } \
gettimeofday(&start_t, NULL); \ gettimeofday(&start_t, NULL); \
...@@ -191,7 +192,10 @@ handle_args(int argc, char *argv[]) ...@@ -191,7 +192,10 @@ handle_args(int argc, char *argv[])
exit(1); exit(1);
} }
printf(_("%d seconds per test\n"), secs_per_test); printf(ngettext("%d second per test\n",
"%d seconds per test\n",
secs_per_test),
secs_per_test);
#if PG_O_DIRECT != 0 #if PG_O_DIRECT != 0
printf(_("O_DIRECT supported on this platform for open_datasync and open_sync.\n")); printf(_("O_DIRECT supported on this platform for open_datasync and open_sync.\n"));
#else #else
...@@ -255,7 +259,7 @@ test_sync(int writes_per_op) ...@@ -255,7 +259,7 @@ test_sync(int writes_per_op)
#ifdef OPEN_DATASYNC_FLAG #ifdef OPEN_DATASYNC_FLAG
if ((tmpfile = open(filename, O_RDWR | O_DSYNC | PG_O_DIRECT, 0)) == -1) if ((tmpfile = open(filename, O_RDWR | O_DSYNC | PG_O_DIRECT, 0)) == -1)
{ {
printf(NA_FORMAT, _("n/a*\n")); printf(NA_FORMAT, _("n/a*"));
fs_warning = true; fs_warning = true;
} }
else else
...@@ -273,7 +277,7 @@ test_sync(int writes_per_op) ...@@ -273,7 +277,7 @@ test_sync(int writes_per_op)
close(tmpfile); close(tmpfile);
} }
#else #else
printf(NA_FORMAT, _("n/a\n")); printf(NA_FORMAT, _("n/a"));
#endif #endif
/* /*
...@@ -298,7 +302,7 @@ test_sync(int writes_per_op) ...@@ -298,7 +302,7 @@ test_sync(int writes_per_op)
STOP_TIMER; STOP_TIMER;
close(tmpfile); close(tmpfile);
#else #else
printf(NA_FORMAT, _("n/a\n")); printf(NA_FORMAT, _("n/a"));
#endif #endif
/* /*
...@@ -346,7 +350,7 @@ test_sync(int writes_per_op) ...@@ -346,7 +350,7 @@ test_sync(int writes_per_op)
STOP_TIMER; STOP_TIMER;
close(tmpfile); close(tmpfile);
#else #else
printf(NA_FORMAT, _("n/a\n")); printf(NA_FORMAT, _("n/a"));
#endif #endif
/* /*
...@@ -358,7 +362,7 @@ test_sync(int writes_per_op) ...@@ -358,7 +362,7 @@ test_sync(int writes_per_op)
#ifdef OPEN_SYNC_FLAG #ifdef OPEN_SYNC_FLAG
if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT, 0)) == -1) if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT, 0)) == -1)
{ {
printf(NA_FORMAT, _("n/a*\n")); printf(NA_FORMAT, _("n/a*"));
fs_warning = true; fs_warning = true;
} }
else else
...@@ -383,7 +387,7 @@ test_sync(int writes_per_op) ...@@ -383,7 +387,7 @@ test_sync(int writes_per_op)
close(tmpfile); close(tmpfile);
} }
#else #else
printf(NA_FORMAT, _("n/a\n")); printf(NA_FORMAT, _("n/a"));
#endif #endif
if (fs_warning) if (fs_warning)
...@@ -424,7 +428,7 @@ test_open_sync(const char *msg, int writes_size) ...@@ -424,7 +428,7 @@ test_open_sync(const char *msg, int writes_size)
#ifdef OPEN_SYNC_FLAG #ifdef OPEN_SYNC_FLAG
if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT, 0)) == -1) if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT, 0)) == -1)
printf(NA_FORMAT, _("n/a*\n")); printf(NA_FORMAT, _("n/a*"));
else else
{ {
START_TIMER; START_TIMER;
...@@ -441,7 +445,7 @@ test_open_sync(const char *msg, int writes_size) ...@@ -441,7 +445,7 @@ test_open_sync(const char *msg, int writes_size)
close(tmpfile); close(tmpfile);
} }
#else #else
printf(NA_FORMAT, _("n/a\n")); printf(NA_FORMAT, _("n/a"));
#endif #endif
} }
...@@ -577,7 +581,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops) ...@@ -577,7 +581,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
double per_second = ops / total_time; double per_second = ops / total_time;
double avg_op_time_us = (total_time / ops) * USECS_SEC; double avg_op_time_us = (total_time / ops) * USECS_SEC;
printf(OPS_FORMAT "\n", per_second, avg_op_time_us); printf(_(OPS_FORMAT), per_second, avg_op_time_us);
} }
#ifndef WIN32 #ifndef WIN32
......
...@@ -300,7 +300,7 @@ XLogDumpXLogRead(const char *directory, TimeLineID timeline_id, ...@@ -300,7 +300,7 @@ XLogDumpXLogRead(const char *directory, TimeLineID timeline_id,
XLogFileName(fname, timeline_id, sendSegNo); XLogFileName(fname, timeline_id, sendSegNo);
fatal_error("could not seek in log segment %s to offset %u: %s", fatal_error("could not seek in log file %s to offset %u: %s",
fname, startoff, strerror(err)); fname, startoff, strerror(err));
} }
sendOff = startoff; sendOff = startoff;
...@@ -320,7 +320,7 @@ XLogDumpXLogRead(const char *directory, TimeLineID timeline_id, ...@@ -320,7 +320,7 @@ XLogDumpXLogRead(const char *directory, TimeLineID timeline_id,
XLogFileName(fname, timeline_id, sendSegNo); XLogFileName(fname, timeline_id, sendSegNo);
fatal_error("could not read from log segment %s, offset %d, length %d: %s", fatal_error("could not read from log file %s, offset %u, length %d: %s",
fname, sendOff, segbytes, strerror(err)); fname, sendOff, segbytes, strerror(err));
} }
...@@ -710,14 +710,14 @@ usage(void) ...@@ -710,14 +710,14 @@ usage(void)
printf(_(" -n, --limit=N number of records to display\n")); printf(_(" -n, --limit=N number of records to display\n"));
printf(_(" -p, --path=PATH directory in which to find log segment files or a\n" printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"
" directory with a ./pg_wal that contains such files\n" " directory with a ./pg_wal that contains such files\n"
" (default: current directory, ./pg_wal, PGDATA/pg_wal)\n")); " (default: current directory, ./pg_wal, $PGDATA/pg_wal)\n"));
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n" printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR;\n"
" use --rmgr=list to list valid resource manager names\n")); " use --rmgr=list to list valid resource manager names\n"));
printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n")); printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n"));
printf(_(" -t, --timeline=TLI timeline from which to read log records\n" printf(_(" -t, --timeline=TLI timeline from which to read log records\n"
" (default: 1 or the value used in STARTSEG)\n")); " (default: 1 or the value used in STARTSEG)\n"));
printf(_(" -V, --version output version information, then exit\n")); printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -x, --xid=XID only show records with TransactionId XID\n")); printf(_(" -x, --xid=XID only show records with transaction ID XID\n"));
printf(_(" -z, --stats[=record] show statistics instead of records\n" printf(_(" -z, --stats[=record] show statistics instead of records\n"
" (optionally, show per-record statistics)\n")); " (optionally, show per-record statistics)\n"));
printf(_(" -?, --help show this help, then exit\n")); printf(_(" -?, --help show this help, then exit\n"));
...@@ -870,7 +870,7 @@ main(int argc, char **argv) ...@@ -870,7 +870,7 @@ main(int argc, char **argv)
case 'x': case 'x':
if (sscanf(optarg, "%u", &config.filter_by_xid) != 1) if (sscanf(optarg, "%u", &config.filter_by_xid) != 1)
{ {
fprintf(stderr, _("%s: could not parse \"%s\" as a valid xid\n"), fprintf(stderr, _("%s: could not parse \"%s\" as a transaction ID\n"),
progname, optarg); progname, optarg);
goto bad_argument; goto bad_argument;
} }
...@@ -910,7 +910,7 @@ main(int argc, char **argv) ...@@ -910,7 +910,7 @@ main(int argc, char **argv)
if (!verify_directory(private.inpath)) if (!verify_directory(private.inpath))
{ {
fprintf(stderr, fprintf(stderr,
_("%s: path \"%s\" cannot be opened: %s\n"), _("%s: path \"%s\" could not be opened: %s\n"),
progname, private.inpath, strerror(errno)); progname, private.inpath, strerror(errno));
goto bad_argument; goto bad_argument;
} }
...@@ -931,7 +931,7 @@ main(int argc, char **argv) ...@@ -931,7 +931,7 @@ main(int argc, char **argv)
private.inpath = directory; private.inpath = directory;
if (!verify_directory(private.inpath)) if (!verify_directory(private.inpath))
fatal_error("cannot open directory \"%s\": %s", fatal_error("could not open directory \"%s\": %s",
private.inpath, strerror(errno)); private.inpath, strerror(errno));
} }
...@@ -1029,7 +1029,9 @@ main(int argc, char **argv) ...@@ -1029,7 +1029,9 @@ main(int argc, char **argv)
* a segment (e.g. we were used in file mode). * a segment (e.g. we were used in file mode).
*/ */
if (first_record != private.startptr && (private.startptr % XLogSegSize) != 0) if (first_record != private.startptr && (private.startptr % XLogSegSize) != 0)
printf(_("first record is after %X/%X, at %X/%X, skipping over %u bytes\n"), printf(ngettext("first record is after %X/%X, at %X/%X, skipping over %u byte\n",
"first record is after %X/%X, at %X/%X, skipping over %u bytes\n",
(first_record - private.startptr)),
(uint32) (private.startptr >> 32), (uint32) private.startptr, (uint32) (private.startptr >> 32), (uint32) private.startptr,
(uint32) (first_record >> 32), (uint32) first_record, (uint32) (first_record >> 32), (uint32) first_record,
(uint32) (first_record - private.startptr)); (uint32) (first_record - private.startptr));
......
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