mirror of
https://github.com/postgres/postgres.git
synced 2025-12-02 23:42:46 +03:00
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
This commit is contained in:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user