summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2022-04-08 13:07:35 +0000
committerPeter Eisentraut2022-04-08 13:16:33 +0000
commit891624f0ec3b3d353269b0bfc7bc545333d6b4d5 (patch)
tree2fd4d6617366b13e3628405a3d5feb81a6da3847
parent8ec569479fc28ddd634a13dc100b36352ec3a3c2 (diff)
psql: Fix translation marking
Commit 5a2832465fd8984d089e8c44c094e6900d987fcd added addFooterToPublicationDesc() as a wrapper around printTableAddFooter(). The translation marker _() was moved to the body of addFooterToPublicationDesc(), but addFooterToPublicationDesc() was not added to GETTEXT_TRIGGERS, so those strings were lost for translation. To fix, add the translation markers to the call sites of addFooterToPublicationDesc() and remove the translation marker from the body of the function. This seems easiest since there were only two callers and it keeps the API consistent with printTableAddFooter(). While we're here, add some const decorations to the prototype of addFooterToPublicationDesc() for consistency with printTableAddFooter().
-rw-r--r--src/bin/psql/describe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 797ef233c90..e8919ab0be2 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -5966,8 +5966,8 @@ listPublications(const char *pattern)
* Add footer to publication description.
*/
static bool
-addFooterToPublicationDesc(PQExpBuffer buf, char *footermsg,
- bool as_schema, printTableContent *cont)
+addFooterToPublicationDesc(PQExpBuffer buf, const char *footermsg,
+ bool as_schema, printTableContent *const cont)
{
PGresult *res;
int count = 0;
@@ -5980,7 +5980,7 @@ addFooterToPublicationDesc(PQExpBuffer buf, char *footermsg,
count = PQntuples(res);
if (count > 0)
- printTableAddFooter(cont, _(footermsg));
+ printTableAddFooter(cont, footermsg);
for (i = 0; i < count; i++)
{
@@ -6149,7 +6149,7 @@ describePublications(const char *pattern)
" AND c.oid = pr.prrelid\n"
" AND pr.prpubid = '%s'\n"
"ORDER BY 1,2", pubid);
- if (!addFooterToPublicationDesc(&buf, "Tables:", false, &cont))
+ if (!addFooterToPublicationDesc(&buf, _("Tables:"), false, &cont))
goto error_return;
if (pset.sversion >= 150000)
@@ -6161,7 +6161,7 @@ describePublications(const char *pattern)
" JOIN pg_catalog.pg_publication_namespace pn ON n.oid = pn.pnnspid\n"
"WHERE pn.pnpubid = '%s'\n"
"ORDER BY 1", pubid);
- if (!addFooterToPublicationDesc(&buf, "Tables from schemas:",
+ if (!addFooterToPublicationDesc(&buf, _("Tables from schemas:"),
true, &cont))
goto error_return;
}