Skip to content

Commit 20f7f01

Browse files
committed
Easier to translate psql help
Instead of requiring translators to translate the entire SQL command synopses, change create_help.pl to only require them to translate the placeholders, and paste those into the synopsis using a printf mechanism. Make some small updates to the markup to make it easier to parse. Note: This causes msgmerge of gettext 0.17 to segfault. You will need the patch from https://savannah.gnu.org/bugs/?27474 to make it work. msgmerge usually only runs on babel.postgresql.org, however.
1 parent ef96196 commit 20f7f01

21 files changed

+139
-71
lines changed

doc/src/sgml/ref/alter_database.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.22 2008/11/14 10:22:45 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.23 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2525

26-
where <replaceable class="PARAMETER">option</replaceable> can be:
26+
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
2727

2828
CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
2929

doc/src/sgml/ref/alter_function.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.17 2008/11/14 10:22:45 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.18 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -30,7 +30,7 @@ ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="paramet
3030
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
3131
SET SCHEMA <replaceable>new_schema</replaceable>
3232

33-
where <replaceable class="PARAMETER">action</replaceable> is one of:
33+
<phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase>
3434

3535
CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
3636
IMMUTABLE | STABLE | VOLATILE

doc/src/sgml/ref/alter_role.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_role.sgml,v 1.12 2009/03/28 03:26:02 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_role.sgml,v 1.13 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
ALTER ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2525

26-
where <replaceable class="PARAMETER">option</replaceable> can be:
26+
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
2727

2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB

doc/src/sgml/ref/alter_table.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.108 2009/08/02 22:14:51 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.109 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -30,7 +30,7 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
3030
ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
3131
SET SCHEMA <replaceable class="PARAMETER">new_schema</replaceable>
3232

33-
where <replaceable class="PARAMETER">action</replaceable> is one of:
33+
<phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase>
3434

3535
ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable class="PARAMETER">type</replaceable> [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
3636
DROP [ COLUMN ] [ IF EXISTS ] <replaceable class="PARAMETER">column</replaceable> [ RESTRICT | CASCADE ]

doc/src/sgml/ref/alter_user.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.45 2008/11/14 10:22:45 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.46 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
ALTER USER <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2525

26-
where <replaceable class="PARAMETER">option</replaceable> can be:
26+
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
2727

2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB

doc/src/sgml/ref/begin.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/begin.sgml,v 1.37 2008/11/14 10:22:45 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/begin.sgml,v 1.38 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</replaceable> [, ...] ]
2525

26-
where <replaceable class="parameter">transaction_mode</replaceable> is one of:
26+
<phrase>where <replaceable class="parameter">transaction_mode</replaceable> is one of:</phrase>
2727

2828
ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
2929
READ WRITE | READ ONLY

doc/src/sgml/ref/create_domain.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.32 2008/11/14 10:22:46 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.33 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -22,10 +22,10 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
CREATE DOMAIN <replaceable class="parameter">name</replaceable> [ AS ] <replaceable class="parameter">data_type</replaceable>
25-
[ DEFAULT <replaceable>expression</> ]
25+
[ DEFAULT <replaceable>expression</replaceable> ]
2626
[ <replaceable class="PARAMETER">constraint</replaceable> [ ... ] ]
2727

28-
where <replaceable class="PARAMETER">constraint</replaceable> is:
28+
<phrase>where <replaceable class="PARAMETER">constraint</replaceable> is:</phrase>
2929

3030
[ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
3131
{ NOT NULL | NULL | CHECK (<replaceable class="PARAMETER">expression</replaceable>) }

doc/src/sgml/ref/create_group.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_group.sgml,v 1.19 2008/11/14 10:22:46 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_group.sgml,v 1.20 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2525

26-
where <replaceable class="PARAMETER">option</replaceable> can be:
26+
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
2727

2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB

doc/src/sgml/ref/create_role.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.11 2008/11/14 10:22:46 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.12 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2525

26-
where <replaceable class="PARAMETER">option</replaceable> can be:
26+
<phrase>where <replaceable class="PARAMETER">option</replaceable> can be:</phrase>
2727

2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB

doc/src/sgml/ref/create_table.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.115 2009/07/29 20:56:17 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.116 2009/09/18 05:00:41 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -22,7 +22,7 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable> ( [
25-
{ <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ DEFAULT <replaceable>default_expr</> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
25+
{ <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ DEFAULT <replaceable>default_expr</replaceable> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
2626
| <replaceable>table_constraint</replaceable>
2727
| LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ] ... }
2828
[, ... ]
@@ -32,7 +32,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
3232
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
3333
[ TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable> ]
3434

35-
where <replaceable class="PARAMETER">column_constraint</replaceable> is:
35+
<phrase>where <replaceable class="PARAMETER">column_constraint</replaceable> is:</phrase>
3636

3737
[ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
3838
{ NOT NULL |
@@ -44,7 +44,7 @@ where <replaceable class="PARAMETER">column_constraint</replaceable> is:
4444
[ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ] }
4545
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
4646

47-
and <replaceable class="PARAMETER">table_constraint</replaceable> is:
47+
<phrase>and <replaceable class="PARAMETER">table_constraint</replaceable> is:</phrase>
4848

4949
[ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
5050
{ UNIQUE ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] ) <replaceable class="PARAMETER">index_parameters</replaceable> |
@@ -54,7 +54,7 @@ and <replaceable class="PARAMETER">table_constraint</replaceable> is:
5454
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ] }
5555
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
5656

57-
<replaceable class="PARAMETER">index_parameters</replaceable> in <literal>UNIQUE</> and <literal>PRIMARY KEY</> constraints are:
57+
<phrase><replaceable class="PARAMETER">index_parameters</replaceable> in <literal>UNIQUE</literal> and <literal>PRIMARY KEY</literal> constraints are:</phrase>
5858

5959
[ WITH ( <replaceable class="PARAMETER">storage_parameter</replaceable> [= <replaceable class="PARAMETER">value</replaceable>] [, ... ] ) ]
6060
[ USING INDEX TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable> ]

0 commit comments

Comments
 (0)