Index: src/bin/pg_dump/pg_dump.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v retrieving revision 1.293 diff -u -r1.293 pg_dump.c --- src/bin/pg_dump/pg_dump.c 2002/08/27 21:04:58 1.293 +++ src/bin/pg_dump/pg_dump.c 2002/08/28 15:29:12 @@ -65,6 +65,7 @@ #include "pg_backup_archiver.h" #include "dumputils.h" +#define _(x) gettext((x)) typedef struct _dumpContext { @@ -420,9 +421,9 @@ else { fprintf(stderr, - gettext("%s: invalid -X option -- %s\n"), + _("%s: invalid -X option -- %s\n"), progname, optarg); - fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname); + fprintf(stderr, _("Try '%s --help' for more information.\n"), progname); exit(1); } break; @@ -433,7 +434,7 @@ #ifndef HAVE_GETOPT_LONG case '-': fprintf(stderr, - gettext("%s was compiled without support for long options.\n" + _("%s was compiled without support for long options.\n" "Use --help for help on invocation options.\n"), progname); exit(1); @@ -444,7 +445,7 @@ break; #endif default: - fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname); + fprintf(stderr, _("Try '%s --help' for more information.\n"), progname); exit(1); } } @@ -452,7 +453,7 @@ if (optind < (argc - 1)) { fprintf(stderr, - gettext("%s: too many command line options (first is '%s')\n" + _("%s: too many command line options (first is '%s')\n" "Try '%s --help' for more information.\n"), progname, argv[optind + 1], progname); exit(1); @@ -649,80 +650,78 @@ static void help(const char *progname) { - printf(gettext("%s dumps a database as a text file or to other formats.\n\n"), progname); - puts(gettext("Usage:")); - printf(gettext(" %s [options] dbname\n\n"), progname); - puts(gettext("Options:")); + printf(_("%s dumps a database as a text file or to other formats.\n\n"), progname); + puts(_("Usage:")); + printf(_(" %s [options] dbname\n\n"), progname); + puts(_("Options:")); #ifdef HAVE_GETOPT_LONG - puts(gettext( - " -a, --data-only dump only the data, not the schema\n" - " -b, --blobs include large objects in dump\n" - " -c, --clean clean (drop) schema prior to create\n" - " -C, --create include commands to create database in dump\n" - " -d, --inserts dump data as INSERT, rather than COPY, commands\n" - " -D, --column-inserts dump data as INSERT commands with column names\n" - " -f, --file=FILENAME output file name\n" - " -F, --format {c|t|p} output file format (custom, tar, plain text)\n" - " -h, --host=HOSTNAME database server host name\n" - " -i, --ignore-version proceed even when server version mismatches\n" - " pg_dump version\n" - " -o, --oids include OIDs in dump\n" - " -O, --no-owner do not output \\connect commands in plain\n" - " text format\n" - " -p, --port=PORT database server port number\n" - " -R, --no-reconnect disable ALL reconnections to the database in\n" - " plain text format\n" - " -s, --schema-only dump only the schema, no data\n" - " -S, --superuser=NAME specify the superuser user name to use in\n" - " plain text format\n" - " -t, --table=TABLE dump this table only (* for all)\n" - " -U, --username=NAME connect as specified database user\n" - " -v, --verbose verbose mode\n" - " -W, --password force password prompt (should happen automatically)\n" - " -x, --no-privileges do not dump privileges (grant/revoke)\n" - " -X use-set-session-authorization, --use-set-session-authorization\n" + puts(_( " -a, --data-only dump only the data, not the schema")); + puts(_( " -b, --blobs include large objects in dump")); + puts(_( " -c, --clean clean (drop) schema prior to create")); + puts(_( " -C, --create include commands to create database in dump")); + puts(_( " -d, --inserts dump data as INSERT, rather than COPY, commands")); + puts(_( " -D, --column-inserts dump data as INSERT commands with column names")); + puts(_( " -f, --file=FILENAME output file name")); + puts(_( " -F, --format {c|t|p} output file format (custom, tar, plain text)")); + puts(_( " -h, --host=HOSTNAME database server host name")); + puts(_( " -i, --ignore-version proceed even when server version mismatches\n" + " pg_dump version")); + puts(_( " -o, --oids include OIDs in dump")); + puts(_( " -O, --no-owner do not output \\connect commands in plain\n" + " text format")); + puts(_( " -p, --port=PORT database server port number")); + puts(_( " -R, --no-reconnect disable ALL reconnections to the database in\n" + " plain text format")); + puts(_( " -s, --schema-only dump only the schema, no data")); + puts(_( " -S, --superuser=NAME specify the superuser user name to use in\n" + " plain text format")); + puts(_( " -t, --table=TABLE dump this table only (* for all)")); + puts(_( " -U, --username=NAME connect as specified database user")); + puts(_( " -v, --verbose verbose mode")); + puts(_( " -W, --password force password prompt (should happen automatically)")); + puts(_( " -x, --no-privileges do not dump privileges (grant/revoke)")); + puts(_( " -X use-set-session-authorization, --use-set-session-authorization\n" " output SET SESSION AUTHORIZATION commands rather\n" - " than \\connect commands\n" - " -X disable-triggers, --disable-triggers\n" - " disable triggers during data-only restore\n" - " -Z, --compress {0-9} compression level for compressed formats\n" - )); + " than \\connect commands")); + puts(_( " -X disable-triggers, --disable-triggers\n" + " disable triggers during data-only restore")); + puts(_( " -Z, --compress {0-9} compression level for compressed formats")); + #else - puts(gettext( - " -a dump only the data, not the schema\n" - " -b include large objects in dump\n" - " -c clean (drop) schema prior to create\n" - " -C include commands to create database in dump\n" - " -d dump data as INSERT, rather than COPY, commands\n" - " -D dump data as INSERT commands with column names\n" - " -f FILENAME output file name\n" - " -F {c|t|p} output file format (custom, tar, plain text)\n" - " -h HOSTNAME database server host name\n" - " -i proceed even when server version mismatches\n" - " pg_dump version\n" - " -o include OIDs in dump\n" - " -O do not output \\connect commands in plain\n" - " text format\n" - " -p PORT database server port number\n" - " -R disable ALL reconnections to the database in\n" - " plain text format\n" - " -s dump only the schema, no data\n" - " -S NAME specify the superuser user name to use in\n" - " plain text format\n" - " -t TABLE dump this table only (* for all)\n" - " -U NAME connect as specified database user\n" - " -v verbose mode\n" - " -W force password prompt (should happen automatically)\n" - " -x do not dump privileges (grant/revoke)\n" - " -X use-set-session-authorization\n" + puts(_( " -a dump only the data, not the schema")); + puts(_( " -b include large objects in dump")); + puts(_( " -c clean (drop) schema prior to create")); + puts(_( " -C include commands to create database in dump")); + puts(_( " -d dump data as INSERT, rather than COPY, commands")); + puts(_( " -D dump data as INSERT commands with column names")); + puts(_( " -f FILENAME output file name")); + puts(_( " -F {c|t|p} output file format (custom, tar, plain text)")); + puts(_( " -h HOSTNAME database server host name")); + puts(_( " -i proceed even when server version mismatches\n" + " pg_dump version")); + puts(_( " -o include OIDs in dump")); + puts(_( " -O do not output \\connect commands in plain\n" + " text format")); + puts(_( " -p PORT database server port number")); + puts(_( " -R disable ALL reconnections to the database in\n" + " plain text format")); + puts(_( " -s dump only the schema, no data")); + puts(_( " -S NAME specify the superuser user name to use in\n" + " plain text format")); + puts(_( " -t TABLE dump this table only (* for all)")); + puts(_( " -U NAME connect as specified database user")); + puts(_( " -v verbose mode")); + puts(_( " -W force password prompt (should happen automatically)")); + puts(_( " -x do not dump privileges (grant/revoke)")); + puts(_( " -X use-set-session-authorization\n" " output SET SESSION AUTHORIZATION commands rather\n" - " than \\connect commands\n" - " -X disable-triggers disable triggers during data-only restore\n" - " -Z {0-9} compression level for compressed formats\n" - )); + " than \\connect commands")); + puts(_( " -X disable-triggers disable triggers during data-only restore")); + puts(_( " -Z {0-9} compression level for compressed formats")); #endif - puts(gettext("If no database name is not supplied, then the PGDATABASE environment\n" + puts(""); + puts(_("If no database name is not supplied, then the PGDATABASE environment\n" "variable value is used.\n\n" "Report bugs to .")); } Index: src/bin/pg_dump/pg_restore.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_restore.c,v retrieving revision 1.39 diff -u -r1.39 pg_restore.c --- src/bin/pg_dump/pg_restore.c 2002/08/27 18:57:26 1.39 +++ src/bin/pg_dump/pg_restore.c 2002/08/28 15:29:12 @@ -63,6 +63,8 @@ #include #endif +#define _(x) gettext((x)) + /* Forward decls */ static void usage(const char *progname); static char *_cleanupName(char *name); @@ -276,9 +278,9 @@ else { fprintf(stderr, - gettext("%s: invalid -X option -- %s\n"), + _("%s: invalid -X option -- %s\n"), progname, optarg); - fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname); + fprintf(stderr, _("Try '%s --help' for more information.\n"), progname); exit(1); } break; @@ -290,7 +292,7 @@ #endif default: - fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname); + fprintf(stderr, _("Try '%s --help' for more information.\n"), progname); exit(1); } } @@ -371,89 +373,85 @@ static void usage(const char *progname) { - printf(gettext( + printf(_( "%s restores a PostgreSQL database from an archive created by pg_dump.\n\n" "Usage:\n %s [options] [file]\n\n" "Options:\n"), progname, progname); #ifdef HAVE_GETOPT_LONG - puts(gettext( - " -a, --data-only restore only the data, no schema\n" - " -c, --clean clean (drop) schema prior to create\n" - " -C, --create issue commands to create the database\n" - " -d, --dbname=NAME output database name\n" - " -f, --file=FILENAME output file name\n" - " -F, --format={c|t} specify backup file format\n" - " -h, --host=HOSTNAME server host name\n" - " -i, --ignore-version proceed even when server version mismatches\n" - " -I, --index=NAME restore named index\n" - " -l, --list print summarized TOC of the archive\n" - " -L, --use-list=FILENAME use specified table of contents for ordering\n" - " output from this file\n" - " -N, --orig-order restore in original dump order\n" - " -o, --oid-order restore in OID order\n" - " -O, --no-owner do not reconnect to database to match\n" - " object owner\n" - " -p, --port=PORT server port number\n" - " -P, --function=NAME(args)restore named function\n" - " -r, --rearrange rearrange output to put indexes etc. at end\n" - " -R, --no-reconnect disallow ALL reconnections to the database\n" - " -s, --schema-only restore only the schema, no data\n" - " -S, --superuser=NAME specify the superuser user name to use for\n" - " disabling triggers\n" - " -t, --table=NAME restore named table\n" - " -T, --trigger=NAME restore named trigger\n" - " -U, --username=NAME connect as specified database user\n" - " -v, --verbose verbose mode\n" - " -W, --password force password prompt (should happen automatically)\n" - " -x, --no-privileges skip restoration of access privileges (grant/revoke)\n" - " -X use-set-session-authorization, --use-set-session-authorization\n" + puts(_( " -a, --data-only restore only the data, no schema")); + puts(_( " -c, --clean clean (drop) schema prior to create")); + puts(_( " -C, --create issue commands to create the database")); + puts(_( " -d, --dbname=NAME output database name")); + puts(_( " -f, --file=FILENAME output file name")); + puts(_( " -F, --format={c|t} specify backup file format")); + puts(_( " -h, --host=HOSTNAME server host name")); + puts(_( " -i, --ignore-version proceed even when server version mismatches")); + puts(_( " -I, --index=NAME restore named index")); + puts(_( " -l, --list print summarized TOC of the archive")); + puts(_( " -L, --use-list=FILENAME use specified table of contents for ordering\n" + " output from this file")); + puts(_( " -N, --orig-order restore in original dump order")); + puts(_( " -o, --oid-order restore in OID order")); + puts(_( " -O, --no-owner do not reconnect to database to match\n" + " object owner")); + puts(_( " -p, --port=PORT server port number")); + puts(_( " -P, --function=NAME(args)restore named function")); + puts(_( " -r, --rearrange rearrange output to put indexes etc. at end")); + puts(_( " -R, --no-reconnect disallow ALL reconnections to the database")); + puts(_( " -s, --schema-only restore only the schema, no data")); + puts(_( " -S, --superuser=NAME specify the superuser user name to use for\n" + " disabling triggers")); + puts(_( " -t, --table=NAME restore named table")); + puts(_( " -T, --trigger=NAME restore named trigger")); + puts(_( " -U, --username=NAME connect as specified database user")); + puts(_( " -v, --verbose verbose mode")); + puts(_( " -W, --password force password prompt (should happen automatically)")); + puts(_( " -x, --no-privileges skip restoration of access privileges (grant/revoke)")); + puts(_( " -X use-set-session-authorization, --use-set-session-authorization\n" " use SET SESSION AUTHORIZATION commands instead\n" - " of reconnecting, if possible\n" - " -X disable-triggers, --disable-triggers\n" - " disable triggers during data-only restore\n" - )); + " of reconnecting, if possible")); + puts(_( " -X disable-triggers, --disable-triggers\n" + " disable triggers during data-only restore")); #else /* not HAVE_GETOPT_LONG */ - - puts(gettext( - " -a restore only the data, no schema\n" - " -c clean (drop) schema prior to create\n" - " -C issue commands to create the database\n" - " -d NAME output database name\n" - " -f FILENAME output file name\n" - " -F {c|t} specify backup file format\n" - " -h HOSTNAME server host name\n" - " -i proceed even when server version mismatches\n" - " -I NAME restore named index\n" - " -l print summarized TOC of the archive\n" - " -L FILENAME use specified table of contents for ordering\n" - " output from this file\n" - " -N restore in original dump order\n" - " -o restore in OID order\n" - " -O do not reconnect to database to match\n" - " object owner\n" - " -p PORT server port number\n" - " -P NAME(args) restore named function\n" - " -r rearrange output to put indexes etc. at end\n" - " -R disallow ALL reconnections to the database\n" - " -s restore only the schema, no data\n" - " -S NAME specify the superuser user name to use for\n" - " disabling triggers\n" - " -t NAME restore named table\n" - " -T NAME restore named trigger\n" - " -U NAME connect as specified database user\n" - " -v verbose mode\n" - " -W force password prompt (should happen automatically)\n" - " -x skip restoration of access privileges (grant/revoke)\n" - " -X use-set-session-authorization\n" + puts(_( " -a restore only the data, no schema")); + puts(_( " -c clean (drop) schema prior to create")); + puts(_( " -C issue commands to create the database")); + puts(_( " -d NAME output database name")); + puts(_( " -f FILENAME output file name")); + puts(_( " -F {c|t} specify backup file format")); + puts(_( " -h HOSTNAME server host name")); + puts(_( " -i proceed even when server version mismatches")); + puts(_( " -I NAME restore named index")); + puts(_( " -l print summarized TOC of the archive")); + puts(_( " -L FILENAME use specified table of contents for ordering\n" + " output from this file")); + puts(_( " -N restore in original dump order")); + puts(_( " -o restore in OID order")); + puts(_( " -O do not reconnect to database to match\n" + " object owner")); + puts(_( " -p PORT server port number")); + puts(_( " -P NAME(args) restore named function")); + puts(_( " -r rearrange output to put indexes etc. at end")); + puts(_( " -R disallow ALL reconnections to the database")); + puts(_( " -s restore only the schema, no data")); + puts(_( " -S NAME specify the superuser user name to use for\n" + " disabling triggers")); + puts(_( " -t NAME restore named table")); + puts(_( " -T NAME restore named trigger")); + puts(_( " -U NAME connect as specified database user")); + puts(_( " -v verbose mode")); + puts(_( " -W force password prompt (should happen automatically)")); + puts(_( " -x skip restoration of access privileges (grant/revoke)")); + puts(_( " -X use-set-session-authorization\n" " use SET SESSION AUTHORIZATION commands instead\n" - " of reconnecting, if possible\n" - " -X disable-triggers disable triggers during data-only restore\n" - )); + " of reconnecting, if possible")); + puts(_( " -X disable-triggers disable triggers during data-only restore")); #endif - puts(gettext("If no input file name is supplied, then standard input is used.\n")); - puts(gettext("Report bugs to .")); + puts(""); + puts(_("If no input file name is supplied, then standard input is used.\n")); + puts(_("Report bugs to .")); }