summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-11-28 16:00:57 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-11-28 16:01:59 +0100
commit87c6f8b047d5b0790e6f8b8532f4adf58dc60f67 (patch)
treedbdc53116d7b8bf558492d71cc6e4eff09af56b3 /src
parent8b3e2c622a85208b94808c54d9b40b10b030d304 (diff)
Generate translator comments for GUC parameter descriptions
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 <pavlo.golub@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Reviewed-by: Stéphane Schildknecht <sas.postgresql@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/1a89b3f0-e588-41ef-b712-aba766143cad%40eisentraut.org
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/gen_guc_tables.pl15
1 files changed, 12 insertions, 3 deletions
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};