From 87c6f8b047d5b0790e6f8b8532f4adf58dc60f67 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 28 Nov 2025 16:00:57 +0100 Subject: Generate translator comments for GUC parameter descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatically generate comments like /* translator: GUC parameter "client_min_messages" short description */ in the generated guc_tables.inc.c. This provides translators more context. Reviewed-by: Pavlo Golub Reviewed-by: Álvaro Herrera Reviewed-by: Stéphane Schildknecht Discussion: https://www.postgresql.org/message-id/flat/1a89b3f0-e588-41ef-b712-aba766143cad%40eisentraut.org --- src/backend/utils/misc/gen_guc_tables.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/backend/utils/misc/gen_guc_tables.pl b/src/backend/utils/misc/gen_guc_tables.pl index 562819b7832..64932e102ba 100644 --- a/src/backend/utils/misc/gen_guc_tables.pl +++ b/src/backend/utils/misc/gen_guc_tables.pl @@ -110,11 +110,20 @@ sub print_table printf $ofh "\t\t.name = %s,\n", dquote($entry->{name}); printf $ofh "\t\t.context = %s,\n", $entry->{context}; printf $ofh "\t\t.group = %s,\n", $entry->{group}; + printf $ofh + "\t\t/* translator: GUC parameter \"%s\" short description */\n", + $entry->{name}; printf $ofh "\t\t.short_desc = gettext_noop(%s),\n", dquote($entry->{short_desc}); - printf $ofh "\t\t.long_desc = gettext_noop(%s),\n", - dquote($entry->{long_desc}) - if $entry->{long_desc}; + + if ($entry->{long_desc}) + { + printf $ofh + "\t\t/* translator: GUC parameter \"%s\" long description */\n", + $entry->{name}; + printf $ofh "\t\t.long_desc = gettext_noop(%s),\n", + dquote($entry->{long_desc}); + } printf $ofh "\t\t.flags = %s,\n", $entry->{flags} if $entry->{flags}; printf $ofh "\t\t.vartype = %s,\n", ('PGC_' . uc($entry->{type})); printf $ofh "\t\t._%s = {\n", $entry->{type}; -- cgit v1.2.3