public inbox for [email protected]
help / color / mirror / Atom feedtranslator comments for GUC descriptions useful?
5+ messages / 4 participants
[nested] [flat]
* translator comments for GUC descriptions useful?
@ 2025-11-07 08:53 Peter Eisentraut <[email protected]>
2025-11-07 09:16 ` Re: translator comments for GUC descriptions useful? Pavlo Golub <[email protected]>
2025-11-07 09:57 ` Re: translator comments for GUC descriptions useful? Álvaro Herrera <[email protected]>
2025-11-12 09:02 ` Re: translator comments for GUC descriptions useful? SAS <[email protected]>
2025-11-28 15:18 ` Re: translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
0 siblings, 4 replies; 5+ messages in thread
From: Peter Eisentraut @ 2025-11-07 08:53 UTC (permalink / raw)
To: pgsql-translators
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",
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: translator comments for GUC descriptions useful?
2025-11-07 08:53 translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
@ 2025-11-07 09:16 ` Pavlo Golub <[email protected]>
3 siblings, 0 replies; 5+ messages in thread
From: Pavlo Golub @ 2025-11-07 09:16 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; pgsql-translators
Hi!
>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?
The more context translator has, the better!
>
>
>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",
>
>
--
Hoc est vivere bis, vita posse priore frui.
Nullus est in vitae sensus, ipsa vera est sensus.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: translator comments for GUC descriptions useful?
2025-11-07 08:53 translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
@ 2025-11-07 09:57 ` Álvaro Herrera <[email protected]>
3 siblings, 0 replies; 5+ messages in thread
From: Álvaro Herrera @ 2025-11-07 09:57 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-translators
On 2025-Nov-07, Peter Eisentraut wrote:
> 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 ""
I like this -- yes, please.
> I suppose the only possible disadvantage is that it would use more vertical
> space.
I don't think this is a problem. Translators are likely using GUI
software (at least those that aren't using Vim or Emacs).
> (Any related ideas while we're here?)
Maybe extract each GUC name and grep all errmsg/errdetail/errhint
strings to make sure the name isn't used verbatim (but only via %s
expansion). (Not really sure to what extent this idea is related to
yours, but it's what I got while looking at guc_parameters.dat.)
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: translator comments for GUC descriptions useful?
2025-11-07 08:53 translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
@ 2025-11-12 09:02 ` SAS <[email protected]>
3 siblings, 0 replies; 5+ messages in thread
From: SAS @ 2025-11-12 09:02 UTC (permalink / raw)
To: [email protected]
Hello,
Le 07/11/2025 à 09:53, Peter Eisentraut a écrit :
> 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 really like the idea.
(...)
Best,
--
Dr Stéphane Schildknecht
Contact régional PostgreSQL pour l'Europe francophone
+33 617 11 37 42
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: translator comments for GUC descriptions useful?
2025-11-07 08:53 translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
@ 2025-11-28 15:18 ` Peter Eisentraut <[email protected]>
3 siblings, 0 replies; 5+ messages in thread
From: Peter Eisentraut @ 2025-11-28 15:18 UTC (permalink / raw)
To: pgsql-translators
On 07.11.25 09:53, Peter Eisentraut wrote:
> 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).
I have committed this. (It's only in the master branch right now, so it
won't be active until the messages git repository is branched, usually
in February.)
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2025-11-28 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-07 08:53 translator comments for GUC descriptions useful? Peter Eisentraut <[email protected]>
2025-11-07 09:16 ` Pavlo Golub <[email protected]>
2025-11-07 09:57 ` Álvaro Herrera <[email protected]>
2025-11-12 09:02 ` SAS <[email protected]>
2025-11-28 15:18 ` Peter Eisentraut <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox