Commit 74713483 authored by Peter Eisentraut's avatar Peter Eisentraut

Add NLS to pg_verifybackup

parent 60fbb4d7
# src/bin/pg_verifybackup/nls.mk
CATALOG_NAME = pg_verifybackup
AVAIL_LANGUAGES =
GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) \
parse_manifest.c \
pg_verifybackup.c \
../../common/fe_memutils.c \
../../common/jsonapi.c
GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) \
json_manifest_parse_failure:2 \
error_cb:2 \
report_backup_error:2 \
report_fatal_error
GETTEXT_FLAGS = $(FRONTEND_COMMON_GETTEXT_FLAGS) \
error_cb:2:c-format \
report_backup_error:2:c-format \
report_fatal_error:1:c-format
...@@ -29,7 +29,7 @@ typedef void (*json_manifest_perwalrange_callback)(JsonManifestParseContext *, ...@@ -29,7 +29,7 @@ typedef void (*json_manifest_perwalrange_callback)(JsonManifestParseContext *,
TimeLineID tli, TimeLineID tli,
XLogRecPtr start_lsn, XLogRecPtr end_lsn); XLogRecPtr start_lsn, XLogRecPtr end_lsn);
typedef void (*json_manifest_error_callback)(JsonManifestParseContext *, typedef void (*json_manifest_error_callback)(JsonManifestParseContext *,
char *fmt, ...) pg_attribute_printf(2, 3) const char *fmt, ...) pg_attribute_printf(2, 3)
pg_attribute_noreturn(); pg_attribute_noreturn();
struct JsonManifestParseContext struct JsonManifestParseContext
......
...@@ -124,7 +124,7 @@ static void record_manifest_details_for_wal_range(JsonManifestParseContext *cont ...@@ -124,7 +124,7 @@ static void record_manifest_details_for_wal_range(JsonManifestParseContext *cont
XLogRecPtr start_lsn, XLogRecPtr start_lsn,
XLogRecPtr end_lsn); XLogRecPtr end_lsn);
static void report_manifest_error(JsonManifestParseContext *context, static void report_manifest_error(JsonManifestParseContext *context,
char *fmt,...) const char *fmt,...)
pg_attribute_printf(2, 3) pg_attribute_noreturn(); pg_attribute_printf(2, 3) pg_attribute_noreturn();
static void verify_backup_directory(verifier_context *context, static void verify_backup_directory(verifier_context *context,
...@@ -358,7 +358,7 @@ main(int argc, char **argv) ...@@ -358,7 +358,7 @@ main(int argc, char **argv)
* work quietly. * work quietly.
*/ */
if (!context.saw_any_error && !quiet) if (!context.saw_any_error && !quiet)
printf("backup successfully verified\n"); printf(_("backup successfully verified\n"));
return context.saw_any_error ? 1 : 0; return context.saw_any_error ? 1 : 0;
} }
...@@ -443,12 +443,12 @@ parse_manifest_file(char *manifest_path, manifest_files_hash **ht_p, ...@@ -443,12 +443,12 @@ parse_manifest_file(char *manifest_path, manifest_files_hash **ht_p,
* expects this function not to return. * expects this function not to return.
*/ */
static void static void
report_manifest_error(JsonManifestParseContext *context, char *fmt,...) report_manifest_error(JsonManifestParseContext *context, const char *fmt,...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
pg_log_generic_v(PG_LOG_FATAL, fmt, ap); pg_log_generic_v(PG_LOG_FATAL, gettext(fmt), ap);
va_end(ap); va_end(ap);
exit(1); exit(1);
...@@ -821,7 +821,7 @@ report_backup_error(verifier_context *context, const char *pg_restrict fmt,...) ...@@ -821,7 +821,7 @@ report_backup_error(verifier_context *context, const char *pg_restrict fmt,...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
pg_log_generic_v(PG_LOG_ERROR, fmt, ap); pg_log_generic_v(PG_LOG_ERROR, gettext(fmt), ap);
va_end(ap); va_end(ap);
context->saw_any_error = true; context->saw_any_error = true;
...@@ -838,7 +838,7 @@ report_fatal_error(const char *pg_restrict fmt,...) ...@@ -838,7 +838,7 @@ report_fatal_error(const char *pg_restrict fmt,...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
pg_log_generic_v(PG_LOG_FATAL, fmt, ap); pg_log_generic_v(PG_LOG_FATAL, gettext(fmt), ap);
va_end(ap); va_end(ap);
exit(1); exit(1);
......
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