pg_basebackup: Restore lost translation markers
authorPeter Eisentraut
Mon, 8 May 2023 04:15:26 +0000 (06:15 +0200)
committerPeter Eisentraut
Mon, 8 May 2023 04:15:26 +0000 (06:15 +0200)
The refactoring in ebfb814f7c lost some translation markers.

src/bin/pg_basebackup/nls.mk
src/bin/pg_basebackup/walmethods.c

index 8d28e249dedfb2c723655f38ccb60eb74651a94f..fc475003e8ee210add377662999dee5441564201 100644 (file)
@@ -18,5 +18,5 @@ GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
                    ../../common/file_utils.c \
                    ../../fe_utils/option_utils.c \
                    ../../fe_utils/recovery_gen.c
-GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) simple_prompt tar_set_error
+GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) simple_prompt
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
index 6d14b988cb6e7006451475e17bddfe1e199c8865..1934b7dd46c7ae4cda54dfb058c7ff4bd49b24be 100644 (file)
@@ -718,7 +718,7 @@ tar_write_compressed_data(TarMethodData *tar_data, void *buf, size_t count,
        r = deflate(tar_data->zp, flush ? Z_FINISH : Z_NO_FLUSH);
        if (r == Z_STREAM_ERROR)
        {
-           tar_data->base.lasterrstring = "could not compress data";
+           tar_data->base.lasterrstring = _("could not compress data");
            return false;
        }
 
@@ -747,7 +747,7 @@ tar_write_compressed_data(TarMethodData *tar_data, void *buf, size_t count,
        /* Reset the stream for writing */
        if (deflateReset(tar_data->zp) != Z_OK)
        {
-           tar_data->base.lasterrstring = "could not reset compression stream";
+           tar_data->base.lasterrstring = _("could not reset compression stream");
            return false;
        }
    }
@@ -873,7 +873,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
                pg_free(tar_data->zp);
                tar_data->zp = NULL;
                wwmethod->lasterrstring =
-                   "could not initialize compression library";
+                   _("could not initialize compression library");
                return NULL;
            }
        }
@@ -885,7 +885,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
    if (tar_data->currentfile != NULL)
    {
        wwmethod->lasterrstring =
-           "implementation error: tar files can't have more than one open file";
+           _("implementation error: tar files can't have more than one open file");
        return NULL;
    }
 
@@ -900,7 +900,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
        pg_free(tar_data->currentfile);
        pg_free(tmppath);
        tar_data->currentfile = NULL;
-       wwmethod->lasterrstring = "could not create tar header";
+       wwmethod->lasterrstring = _("could not create tar header");
        return NULL;
    }
 
@@ -917,7 +917,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
        if (deflateParams(tar_data->zp, 0, Z_DEFAULT_STRATEGY) != Z_OK)
        {
            wwmethod->lasterrstring =
-               "could not change compression parameters";
+               _("could not change compression parameters");
            return NULL;
        }
    }
@@ -958,7 +958,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
        if (deflateParams(tar_data->zp, wwmethod->compression_level,
                          Z_DEFAULT_STRATEGY) != Z_OK)
        {
-           wwmethod->lasterrstring = "could not change compression parameters";
+           wwmethod->lasterrstring = _("could not change compression parameters");
            return NULL;
        }
    }
@@ -1049,7 +1049,7 @@ tar_close(Walfile *f, WalCloseMethod method)
    {
        if (f->wwmethod->compression_algorithm != PG_COMPRESSION_NONE)
        {
-           f->wwmethod->lasterrstring = "unlink not supported with compression";
+           f->wwmethod->lasterrstring = _("unlink not supported with compression");
            return -1;
        }
 
@@ -1163,7 +1163,7 @@ tar_close(Walfile *f, WalCloseMethod method)
        /* Turn off compression */
        if (deflateParams(tar_data->zp, 0, Z_DEFAULT_STRATEGY) != Z_OK)
        {
-           f->wwmethod->lasterrstring = "could not change compression parameters";
+           f->wwmethod->lasterrstring = _("could not change compression parameters");
            return -1;
        }
 
@@ -1176,7 +1176,7 @@ tar_close(Walfile *f, WalCloseMethod method)
        if (deflateParams(tar_data->zp, f->wwmethod->compression_level,
                          Z_DEFAULT_STRATEGY) != Z_OK)
        {
-           f->wwmethod->lasterrstring = "could not change compression parameters";
+           f->wwmethod->lasterrstring = _("could not change compression parameters");
            return -1;
        }
    }
@@ -1261,7 +1261,7 @@ tar_finish(WalWriteMethod *wwmethod)
 
            if (r == Z_STREAM_ERROR)
            {
-               wwmethod->lasterrstring = "could not compress data";
+               wwmethod->lasterrstring = _("could not compress data");
                return false;
            }
            if (tar_data->zp->avail_out < ZLIB_OUT_SIZE)
@@ -1285,7 +1285,7 @@ tar_finish(WalWriteMethod *wwmethod)
 
        if (deflateEnd(tar_data->zp) != Z_OK)
        {
-           wwmethod->lasterrstring = "could not close compression stream";
+           wwmethod->lasterrstring = _("could not close compression stream");
            return false;
        }
    }