Make more consistent some translated strings related to compression
authorMichael Paquier <michael@paquier.xyz>
Wed, 21 Dec 2022 01:39:06 +0000 (10:39 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 21 Dec 2022 01:39:06 +0000 (10:39 +0900)
This commit changes some of the bbstreamer files and pg_dump to use the
same style as a few other places (like common/compression.c), where the
name of the compression method is not part of the string, but an
argument of it.  This reduces a bit the translation work with less
string patterns.

Discussion: https://postgr.es/m/Y5/5tdK+4n3clvtU@paquier.xyz

src/bin/pg_basebackup/bbstreamer_gzip.c
src/bin/pg_basebackup/bbstreamer_lz4.c
src/bin/pg_basebackup/bbstreamer_zstd.c
src/bin/pg_dump/compress_io.c

index c3455ffbddf88f8195bc69ecf3edfd7ed5079ecd..ad1b79e6f2b7199ae72987cad30da660c0cb802c 100644 (file)
@@ -113,7 +113,7 @@ bbstreamer_gzip_writer_new(char *pathname, FILE *file,
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support gzip compression");
+   pg_fatal("this build does not support compression with %s", "gzip");
    return NULL;                /* keep compiler quiet */
 #endif
 }
@@ -246,7 +246,7 @@ bbstreamer_gzip_decompressor_new(bbstreamer *next)
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support gzip compression");
+   pg_fatal("this build does not support compression with %s", "gzip");
    return NULL;                /* keep compiler quiet */
 #endif
 }
index ed2aa01305719e9ad9c28a9df00af9f0916108ef..14282c483318dc61d443fe8a672d4193aeec02b0 100644 (file)
@@ -97,7 +97,7 @@ bbstreamer_lz4_compressor_new(bbstreamer *next, pg_compress_specification *compr
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support lz4 compression");
+   pg_fatal("this build does not support compression with %s", "LZ4");
    return NULL;                /* keep compiler quiet */
 #endif
 }
@@ -295,7 +295,7 @@ bbstreamer_lz4_decompressor_new(bbstreamer *next)
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support lz4 compression");
+   pg_fatal("this build does not support compression with %s", "LZ4");
    return NULL;                /* keep compiler quiet */
 #endif
 }
index 1207dd771ae55bc0a2b949d520029c4bd7cf67d4..72cd052c7d93e3828236dd4936e6f20b425015bd 100644 (file)
@@ -113,7 +113,7 @@ bbstreamer_zstd_compressor_new(bbstreamer *next, pg_compress_specification *comp
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support zstd compression");
+   pg_fatal("this build does not support compression with %s", "ZSTD");
    return NULL;                /* keep compiler quiet */
 #endif
 }
@@ -268,7 +268,7 @@ bbstreamer_zstd_decompressor_new(bbstreamer *next)
 
    return &streamer->base;
 #else
-   pg_fatal("this build does not support zstd compression");
+   pg_fatal("this build does not support compression with %s", "ZSTD");
    return NULL;                /* keep compiler quiet */
 #endif
 }
index a7df600cc00d40dd3f59b3b81306e63fe4d15c76..26967eb618d303ef74e0328baf4dff52c027ebce 100644 (file)
@@ -101,7 +101,7 @@ AllocateCompressor(const pg_compress_specification compression_spec,
 
 #ifndef HAVE_LIBZ
    if (compression_spec.algorithm == PG_COMPRESSION_GZIP)
-       pg_fatal("not built with zlib support");
+       pg_fatal("this build does not support compression with %s", "gzip");
 #endif
 
    cs = (CompressorState *) pg_malloc0(sizeof(CompressorState));
@@ -135,7 +135,7 @@ ReadDataFromArchive(ArchiveHandle *AH,
 #ifdef HAVE_LIBZ
        ReadDataFromArchiveZlib(AH, readF);
 #else
-       pg_fatal("not built with zlib support");
+       pg_fatal("this build does not support compression with %s", "gzip");
 #endif
    }
 }
@@ -153,7 +153,7 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
 #ifdef HAVE_LIBZ
            WriteDataToArchiveZlib(AH, cs, data, dLen);
 #else
-           pg_fatal("not built with zlib support");
+           pg_fatal("this build does not support compression with %s", "gzip");
 #endif
            break;
        case PG_COMPRESSION_NONE:
@@ -482,7 +482,7 @@ cfopen_write(const char *path, const char *mode,
        fp = cfopen(fname, mode, compression_spec);
        free_keep_errno(fname);
 #else
-       pg_fatal("not built with zlib support");
+       pg_fatal("this build does not support compression with %s", "gzip");
        fp = NULL;              /* keep compiler quiet */
 #endif
    }
@@ -526,7 +526,7 @@ cfopen(const char *path, const char *mode,
            fp = NULL;
        }
 #else
-       pg_fatal("not built with zlib support");
+       pg_fatal("this build does not support compression with %s", "gzip");
 #endif
    }
    else