From a7e2bdced47635e0e3e4389c40a3ec486487a2c0 Mon Sep 17 00:00:00 2001 From: "Jonathan Gonzalez V." Date: Tue, 16 Sep 2025 16:53:39 +0200 Subject: [PATCH 3/3] Make translation-compatible Previous patch was missing the gettext_noop() disabling the translation for the backend descriptions, now is compatible and is added to the translation files Signed-off-by: Jonathan Gonzalez V. --- src/backend/nls.mk | 2 +- src/backend/utils/init/miscinit.c | 4 +-- src/include/postmaster/proctypelist.h | 37 ++++++++++++++------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/backend/nls.mk b/src/backend/nls.mk index b7d5dd46e45..698b1083f4b 100644 --- a/src/backend/nls.mk +++ b/src/backend/nls.mk @@ -28,7 +28,7 @@ GETTEXT_FLAGS = $(BACKEND_COMMON_GETTEXT_FLAGS) \ error_cb:2:c-format gettext-files: generated-parser-sources generated-headers - find $(srcdir) $(srcdir)/../common $(srcdir)/../port -name '*.c' -print | LC_ALL=C sort >$@ + find $(srcdir) $(srcdir)/../common $(srcdir)/../port $(srcdir)/../include/ \( -name '*.c' -o -name "proctypelist.h" \) -print | LC_ALL=C sort >$@ my-clean: rm -f gettext-files diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 749fb502e95..fec79992c8d 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -266,8 +266,8 @@ GetBackendTypeDesc(BackendType backendType) switch (backendType) { -#define PG_PROCTYPE(bktype, description, main_func, shmem_attach) \ - case bktype: backendDesc = gettext_noop(description); break; +#define PG_PROCTYPE(bktype, description, main_func, shmem_attach) \ + case bktype: backendDesc = description; break; #include "postmaster/proctypelist.h" #undef PG_PROCTYPE } diff --git a/src/include/postmaster/proctypelist.h b/src/include/postmaster/proctypelist.h index 919f00bb3a7..242862451d8 100644 --- a/src/include/postmaster/proctypelist.h +++ b/src/include/postmaster/proctypelist.h @@ -29,22 +29,23 @@ * entries. */ + /* bktype, description, main_func, shmem_attach */ -PG_PROCTYPE(B_ARCHIVER, "archiver", PgArchiverMain, true) -PG_PROCTYPE(B_AUTOVAC_LAUNCHER, "autovacuum launcher", AutoVacLauncherMain, true) -PG_PROCTYPE(B_AUTOVAC_WORKER, "autovacuum worker", AutoVacWorkerMain, true) -PG_PROCTYPE(B_BACKEND, "client backend", BackendMain, true) -PG_PROCTYPE(B_BG_WORKER, "background worker", BackgroundWorkerMain, true) -PG_PROCTYPE(B_BG_WRITER, "background writer", BackgroundWriterMain, true) -PG_PROCTYPE(B_CHECKPOINTER, "checkpointer", CheckpointerMain, true) -PG_PROCTYPE(B_DEAD_END_BACKEND, "dead-end client backend", BackendMain, true) -PG_PROCTYPE(B_INVALID, "unrecognized", NULL, false) -PG_PROCTYPE(B_IO_WORKER, "io worker", IoWorkerMain, true) -PG_PROCTYPE(B_LOGGER, "syslogger", SysLoggerMain, false) -PG_PROCTYPE(B_SLOTSYNC_WORKER, "slotsync worker", ReplSlotSyncWorkerMain, true) -PG_PROCTYPE(B_STANDALONE_BACKEND, "standalone backend", NULL, false) -PG_PROCTYPE(B_STARTUP, "startup", StartupProcessMain, true) -PG_PROCTYPE(B_WAL_RECEIVER, "walreceiver", WalReceiverMain, true) -PG_PROCTYPE(B_WAL_SENDER, "walsender", NULL, true) -PG_PROCTYPE(B_WAL_SUMMARIZER, "walsummarizer", WalSummarizerMain, true) -PG_PROCTYPE(B_WAL_WRITER, "walwriter", WalWriterMain, true) +PG_PROCTYPE(B_ARCHIVER, gettext_noop("archiver"), PgArchiverMain, true) +PG_PROCTYPE(B_AUTOVAC_LAUNCHER, gettext_noop("autovacuum launcher"), AutoVacLauncherMain, true) +PG_PROCTYPE(B_AUTOVAC_WORKER, gettext_noop("autovacuum worker"), AutoVacWorkerMain, true) +PG_PROCTYPE(B_BACKEND, gettext_noop("client backend"), BackendMain, true) +PG_PROCTYPE(B_BG_WORKER, gettext_noop("background worker"), BackgroundWorkerMain, true) +PG_PROCTYPE(B_BG_WRITER, gettext_noop("background writer"), BackgroundWriterMain, true) +PG_PROCTYPE(B_CHECKPOINTER, gettext_noop("checkpointer"), CheckpointerMain, true) +PG_PROCTYPE(B_DEAD_END_BACKEND, gettext_noop("dead-end client backend"), BackendMain, true) +PG_PROCTYPE(B_INVALID, gettext_noop("unrecognized"), NULL, false) +PG_PROCTYPE(B_IO_WORKER, gettext_noop("io worker"), IoWorkerMain, true) +PG_PROCTYPE(B_LOGGER, gettext_noop("syslogger"), SysLoggerMain, false) +PG_PROCTYPE(B_SLOTSYNC_WORKER, gettext_noop("slotsync worker"), ReplSlotSyncWorkerMain, true) +PG_PROCTYPE(B_STANDALONE_BACKEND, gettext_noop("standalone backend"), NULL, false) +PG_PROCTYPE(B_STARTUP, gettext_noop("startup"), StartupProcessMain, true) +PG_PROCTYPE(B_WAL_RECEIVER, gettext_noop("walreceiver"), WalReceiverMain, true) +PG_PROCTYPE(B_WAL_SENDER, gettext_noop("walsender"), NULL, true) +PG_PROCTYPE(B_WAL_SUMMARIZER, gettext_noop("walsummarizer"), WalSummarizerMain, true) +PG_PROCTYPE(B_WAL_WRITER, gettext_noop("walwriter"), WalWriterMain, true) -- 2.48.1