Refactor some error messages for easier translation
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 12 May 2021 05:20:10 +0000 (07:20 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 12 May 2021 05:42:51 +0000 (07:42 +0200)
src/backend/access/common/toast_compression.c
src/backend/parser/parse_coerce.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/xml.c

index 52dedac263d7194548c6845e21c14588236158ef..682fd70e2ef9b31f1283957692fb743b4bafcc56 100644 (file)
@@ -31,7 +31,7 @@ int      default_toast_compression = TOAST_PGLZ_COMPRESSION;
            (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
             errmsg("unsupported LZ4 compression method"), \
             errdetail("This functionality requires the server to be built with lz4 support."), \
-            errhint("You need to rebuild PostgreSQL using --with-lz4.")))
+            errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4")))
 
 /*
  * Compress a varlena using PGLZ.
index aa4a21126d32bf9ac1ada22c86c712f3abfd160f..7e963b8895239a16a1499440d7916110baa668a2 100644 (file)
@@ -2086,7 +2086,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
            if (OidIsValid(elem_typeid) && actual_type != elem_typeid)
                ereport(ERROR,
                        (errcode(ERRCODE_DATATYPE_MISMATCH),
-                        errmsg("arguments declared \"anyelement\" are not all alike"),
+                        errmsg("arguments declared \"%s\" are not all alike", "anyelement"),
                         errdetail("%s versus %s",
                                   format_type_be(elem_typeid),
                                   format_type_be(actual_type))));
@@ -2106,7 +2106,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
            if (OidIsValid(array_typeid) && actual_type != array_typeid)
                ereport(ERROR,
                        (errcode(ERRCODE_DATATYPE_MISMATCH),
-                        errmsg("arguments declared \"anyarray\" are not all alike"),
+                        errmsg("arguments declared \"%s\" are not all alike", "anyarray"),
                         errdetail("%s versus %s",
                                   format_type_be(array_typeid),
                                   format_type_be(actual_type))));
@@ -2126,7 +2126,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
            if (OidIsValid(range_typeid) && actual_type != range_typeid)
                ereport(ERROR,
                        (errcode(ERRCODE_DATATYPE_MISMATCH),
-                        errmsg("arguments declared \"anyrange\" are not all alike"),
+                        errmsg("arguments declared \"%s\" are not all alike", "anyrange"),
                         errdetail("%s versus %s",
                                   format_type_be(range_typeid),
                                   format_type_be(actual_type))));
@@ -2146,7 +2146,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
            if (OidIsValid(multirange_typeid) && actual_type != multirange_typeid)
                ereport(ERROR,
                        (errcode(ERRCODE_DATATYPE_MISMATCH),
-                        errmsg("arguments declared \"anymultirange\" are not all alike"),
+                        errmsg("arguments declared \"%s\" are not all alike", "anymultirange"),
                         errdetail("%s versus %s",
                                   format_type_be(multirange_typeid),
                                   format_type_be(actual_type))));
@@ -2201,7 +2201,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
                if (anycompatible_range_typeid != actual_type)
                    ereport(ERROR,
                            (errcode(ERRCODE_DATATYPE_MISMATCH),
-                            errmsg("arguments declared \"anycompatiblerange\" are not all alike"),
+                            errmsg("arguments declared \"%s\" are not all alike", "anycompatiblerange"),
                             errdetail("%s versus %s",
                                       format_type_be(anycompatible_range_typeid),
                                       format_type_be(actual_type))));
@@ -2234,7 +2234,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
                if (anycompatible_multirange_typeid != actual_type)
                    ereport(ERROR,
                            (errcode(ERRCODE_DATATYPE_MISMATCH),
-                            errmsg("arguments declared \"anycompatiblemultirange\" are not all alike"),
+                            errmsg("arguments declared \"%s\" are not all alike", "anycompatiblemultirange"),
                             errdetail("%s versus %s",
                                       format_type_be(anycompatible_multirange_typeid),
                                       format_type_be(actual_type))));
index eab089f252f7dd1bc6684edcea250526f51d5949..caa09d6373e9397cceaee40ff3c30991e62048c2 100644 (file)
@@ -1586,7 +1586,7 @@ pg_newlocale_from_collation(Oid collid)
            ereport(ERROR,
                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                     errmsg("ICU is not supported in this build"), \
-                    errhint("You need to rebuild PostgreSQL using --with-icu.")));
+                    errhint("You need to rebuild PostgreSQL using %s.", "--with-icu")));
 #endif                         /* not USE_ICU */
        }
 
index 7350940b66dcdaf0b5e5e3322c3de7722fbe63e2..3ae5cfac9e0f02c3c691278271c65ec6ab750df8 100644 (file)
@@ -221,7 +221,7 @@ const TableFuncRoutine XmlTableRoutine =
            (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
             errmsg("unsupported XML feature"), \
             errdetail("This functionality requires the server to be built with libxml support."), \
-            errhint("You need to rebuild PostgreSQL using --with-libxml.")))
+            errhint("You need to rebuild PostgreSQL using %s.", "--with-libxml")))
 
 
 /* from SQL/XML:2008 section 4.9 */