public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: [email protected] <[email protected]>
Subject: translator comments for GUC descriptions useful?
Date: Fri, 7 Nov 2025 09:53:38 +0100
Message-ID: <[email protected]> (raw)

Hi all,

I've done some work recently in the source code to make the GUC C 
structs automatically generated.  That now allows changing the output 
format more easily.

One random idea I had is that we could automatically generate 
"translator" comments on the short and long description strings of GUC 
parameters.  So the PO entries could then look like this:

#. translator: GUC huge_pages_status short description
#: utils/misc/guc_tables.c:5020
msgid "Indicates the status of huge pages."
msgstr ""

(and analogously for the long description).

This would be trivial to implement now (see below for an example).

Would this be useful?

I suppose the only possible disadvantage is that it would use more 
vertical space.

(Any related ideas while we're here?)


diff --git a/src/backend/utils/misc/gen_guc_tables.pl 
b/src/backend/utils/misc/gen_guc_tables.pl
index 601c34ec30b..25aa98debed 100644
--- a/src/backend/utils/misc/gen_guc_tables.pl
+++ b/src/backend/utils/misc/gen_guc_tables.pl
@@ -62,6 +62,7 @@ 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 %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",





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: translator comments for GUC descriptions useful?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox