diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2001-06-02 18:25:18 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2001-06-02 18:25:18 +0000 |
commit | e54203646176167271dc50a7b8f7bbe0d3ea6e75 (patch) | |
tree | 06e6275b18f1d14afeda777f12f31a75d3c8b527 /src/bin | |
parent | 58193c5f37838b49043925437e3c99711ca66407 (diff) | |
download | postgresql-e54203646176167271dc50a7b8f7bbe0d3ea6e75.tar.gz postgresql-e54203646176167271dc50a7b8f7bbe0d3ea6e75.zip |
Native Language Support (NLS)
Use --enable-nls to turn it on; see installation instructions for details.
See developer's guide how to make use of it in programs and how to add
translations.
psql sources have been almost fully prepared and an incomplete German
translation has been provided. In the backend, only elog() calls are
currently translatable, and the provided German translation file is more
of a placeholder.
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/psql/command.c | 54 | ||||
-rw-r--r-- | src/bin/psql/common.c | 36 | ||||
-rw-r--r-- | src/bin/psql/copy.c | 10 | ||||
-rw-r--r-- | src/bin/psql/de.po | 827 | ||||
-rw-r--r-- | src/bin/psql/help.c | 189 | ||||
-rw-r--r-- | src/bin/psql/large_obj.c | 29 | ||||
-rw-r--r-- | src/bin/psql/mainloop.c | 5 | ||||
-rw-r--r-- | src/bin/psql/nls.mk | 7 | ||||
-rw-r--r-- | src/bin/psql/print.c | 8 | ||||
-rw-r--r-- | src/bin/psql/startup.c | 69 |
10 files changed, 1041 insertions, 193 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index e17f8a04b4f..08692b6600c 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.54 2001/05/12 19:44:46 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.55 2001/06/02 18:25:17 petere Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -156,7 +156,7 @@ HandleSlashCmds(const char *line, if (status == CMD_UNKNOWN) { if (pset.cur_cmd_interactive) - fprintf(stderr, "Invalid command \\%s. Try \\? for help.\n", my_line); + fprintf(stderr, gettext("Invalid command \\%s. Try \\? for help.\n"), my_line); else psql_error("invalid command \\%s\n", my_line); status = CMD_ERROR; @@ -582,7 +582,7 @@ exec_command(const char *cmd, if (query_buf && query_buf->len > 0) puts(query_buf->data); else if (!quiet) - puts("Query buffer is empty."); + puts(gettext("Query buffer is empty.")); fflush(stdout); } @@ -613,7 +613,7 @@ exec_command(const char *cmd, { resetPQExpBuffer(query_buf); if (!quiet) - puts("Query buffer reset (cleared)."); + puts(gettext("Query buffer reset (cleared).")); } /* \s save history in a file or show it on the screen */ @@ -624,7 +624,7 @@ exec_command(const char *cmd, success = saveHistory(fname ? fname : "/dev/tty"); if (success && !quiet && fname) - printf("Wrote history to %s.\n", fname); + printf(gettext("Wrote history to %s.\n"), fname); free(fname); } @@ -1314,7 +1314,7 @@ do_connect(const char *new_dbname, const char *new_user) PQfinish(pset.db); if (oldconn) { - fputs("Previous connection kept\n", stderr); + fputs(gettext("Previous connection kept\n"), stderr); pset.db = oldconn; } else @@ -1339,12 +1339,12 @@ do_connect(const char *new_dbname, const char *new_user) if (!QUIET()) { if (userparam != new_user) /* no new user */ - printf("You are now connected to database %s.\n", dbparam); + printf(gettext("You are now connected to database %s.\n"), dbparam); else if (dbparam != new_dbname) /* no new db */ - printf("You are now connected as new user %s.\n", new_user); + printf(gettext("You are now connected as new user %s.\n"), new_user); else /* both new */ - printf("You are now connected to database %s as user %s.\n", + printf(gettext("You are now connected to database %s as user %s.\n"), PQdb(pset.db), PQuser(pset.db)); } @@ -1672,7 +1672,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) } if (!quiet) - printf("Output format is %s.\n", _align2string(popt->topt.format)); + printf(gettext("Output format is %s.\n"), _align2string(popt->topt.format)); } /* set border style/width */ @@ -1682,7 +1682,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) popt->topt.border = atoi(value); if (!quiet) - printf("Border style is %d.\n", popt->topt.border); + printf(gettext("Border style is %d.\n"), popt->topt.border); } /* set expanded/vertical mode */ @@ -1690,7 +1690,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) { popt->topt.expanded = !popt->topt.expanded; if (!quiet) - printf("Expanded display is %s.\n", popt->topt.expanded ? "on" : "off"); + printf(popt->topt.expanded + ? gettext("Expanded display is on.\n") + : gettext("Expanded display is off.\n")); } /* null display */ @@ -1702,7 +1704,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) popt->nullPrint = xstrdup(value); } if (!quiet) - printf("Null display is '%s'.\n", popt->nullPrint ? popt->nullPrint : ""); + printf(gettext("Null display is '%s'.\n"), popt->nullPrint ? popt->nullPrint : ""); } /* field separator for unaligned text */ @@ -1714,7 +1716,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) popt->topt.fieldSep = xstrdup(value); } if (!quiet) - printf("Field separator is '%s'.\n", popt->topt.fieldSep); + printf(gettext("Field separator is '%s'.\n"), popt->topt.fieldSep); } /* record separator for unaligned text */ @@ -1728,9 +1730,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (strcmp(popt->topt.recordSep, "\n") == 0) - printf("Record separator is <newline>."); + printf(gettext("Record separator is <newline>.")); else - printf("Record separator is '%s'.\n", popt->topt.recordSep); + printf(gettext("Record separator is '%s'.\n"), popt->topt.recordSep); } } @@ -1741,9 +1743,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (popt->topt.tuples_only) - puts("Showing only tuples."); + puts(gettext("Showing only tuples.")); else - puts("Tuples only is off."); + puts(gettext("Tuples only is off.")); } } @@ -1759,9 +1761,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (popt->title) - printf("Title is \"%s\".\n", popt->title); + printf(gettext("Title is \"%s\".\n"), popt->title); else - printf("Title is unset.\n"); + printf(gettext("Title is unset.\n")); } } @@ -1777,9 +1779,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (popt->topt.tableAttr) - printf("Table attribute is \"%s\".\n", popt->topt.tableAttr); + printf(gettext("Table attribute is \"%s\".\n"), popt->topt.tableAttr); else - printf("Table attributes unset.\n"); + printf(gettext("Table attributes unset.\n")); } } @@ -1790,9 +1792,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (popt->topt.pager) - puts("Using pager is on."); + puts(gettext("Using pager is on.")); else - puts("Using pager is off."); + puts(gettext("Using pager is off.")); } } @@ -1803,9 +1805,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) if (!quiet) { if (popt->default_footer) - puts("Default footer is on."); + puts(gettext("Default footer is on.")); else - puts("Default footer is off."); + puts(gettext("Default footer is off.")); } } diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index fa4844a699a..941a3b83f8a 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.32 2001/04/15 00:43:37 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.33 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" @@ -47,7 +47,7 @@ xstrdup(const char *string) if (!string) { - fprintf(stderr, "%s: xstrdup: cannot duplicate null pointer (internal error)\n", + fprintf(stderr, gettext("%s: xstrdup: cannot duplicate null pointer (internal error)\n"), pset.progname); exit(EXIT_FAILURE); } @@ -139,7 +139,7 @@ psql_error(const char *fmt,...) if (pset.inputfile) fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno); va_start(ap, fmt); - vfprintf(stderr, fmt, ap); + vfprintf(stderr, gettext(fmt), ap); va_end(ap); } @@ -187,7 +187,7 @@ simple_prompt(const char *prompt, int maxlen, bool echo) if (!destination) return NULL; if (prompt) - fputs(prompt, stderr); + fputs(gettext(prompt), stderr); prompt_state = true; @@ -303,7 +303,9 @@ PSQLexec(const char *query) var = GetVariable(pset.vars, "ECHO_HIDDEN"); if (var) { - printf("********* QUERY *********\n%s\n*************************\n\n", query); + printf("********* QUERY **********\n" + "%s\n" + "**************************\n\n", query); fflush(stdout); } @@ -336,11 +338,11 @@ PSQLexec(const char *query) psql_error("connection to server was lost\n"); exit(EXIT_BADCONN); } - fputs("The connection to the server was lost. Attempting reset: ", stderr); + fputs(gettext("The connection to the server was lost. Attempting reset: "), stderr); PQreset(pset.db); if (PQstatus(pset.db) == CONNECTION_BAD) { - fputs("Failed.\n", stderr); + fputs(gettext("Failed.\n"), stderr); PQfinish(pset.db); pset.db = NULL; SetVariable(pset.vars, "DBNAME", NULL); @@ -350,7 +352,7 @@ PSQLexec(const char *query) SetVariable(pset.vars, "ENCODING", NULL); } else - fputs("Succeeded.\n", stderr); + fputs(gettext("Succeeded.\n"), stderr); } return NULL; @@ -388,9 +390,9 @@ SendQuery(const char *query) { char buf[3]; - printf("***(Single step mode: Verify query)*********************************************\n" - "%s\n" - "***(press return to proceed or enter x and return to cancel)********************\n", + printf(gettext("***(Single step mode: Verify query)*********************************************\n" + "%s\n" + "***(press return to proceed or enter x and return to cancel)********************\n"), query); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) != NULL) @@ -480,8 +482,8 @@ SendQuery(const char *query) case PGRES_COPY_IN: if (pset.cur_cmd_interactive && !QUIET()) - puts("Enter data to be copied followed by a newline.\n" - "End with a backslash and a period on a line by itself."); + puts(gettext("Enter data to be copied followed by a newline.\n" + "End with a backslash and a period on a line by itself.")); success = handleCopyIn(pset.db, pset.cur_cmd_source, pset.cur_cmd_interactive ? get_prompt(PROMPT_COPY) : NULL); @@ -504,11 +506,11 @@ SendQuery(const char *query) psql_error("connection to server was lost\n"); exit(EXIT_BADCONN); } - fputs("The connection to the server was lost. Attempting reset: ", stderr); + fputs(gettext("The connection to the server was lost. Attempting reset: "), stderr); PQreset(pset.db); if (PQstatus(pset.db) == CONNECTION_BAD) { - fputs("Failed.\n", stderr); + fputs(gettext("Failed.\n"), stderr); PQfinish(pset.db); PQclear(results); pset.db = NULL; @@ -520,13 +522,13 @@ SendQuery(const char *query) return false; } else - fputs("Succeeded.\n", stderr); + fputs(gettext("Succeeded.\n"), stderr); } /* check for asynchronous notification returns */ while ((notify = PQnotifies(pset.db)) != NULL) { - fprintf(pset.queryFout, "Asynchronous NOTIFY '%s' from backend with pid '%d' received.\n", + fprintf(pset.queryFout, gettext("Asynchronous NOTIFY '%s' from backend with pid '%d' received.\n"), notify->relname, notify->be_pid); free(notify); fflush(pset.queryFout); diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index d89d7bec360..0f5cb1e8d83 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.18 2001/03/22 04:00:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.19 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" #include "copy.h" @@ -207,10 +207,10 @@ parse_slash_copy(const char *args) if (error) { - psql_error("\\copy: parse error at %s%s%s\n", - token ? "'" : "", - token ? token : "end of line", - token ? "'" : ""); + if (token) + psql_error("\\copy: parse error at '%s'\n", token); + else + psql_error("\\copy: parse error at end of line\n"); free_copy_options(result); return NULL; } diff --git a/src/bin/psql/de.po b/src/bin/psql/de.po new file mode 100644 index 00000000000..b373dd836fc --- /dev/null +++ b/src/bin/psql/de.po @@ -0,0 +1,827 @@ +# $Header: /cvsroot/pgsql/src/bin/psql/Attic/de.po,v 1.1 2001/06/02 18:25:18 petere Exp $ +# +msgid "" +msgstr "" +"Project-Id-Version: PostgreSQL 7.2\n" +"POT-Creation-Date: 2001-06-02 18:26+0200\n" +"PO-Revision-Date: 2001-06-02 15:52+0200\n" +"Last-Translator: Peter Eisentraut <peter_e@gmx.net>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: command.c:152 +msgid "Warning: this syntax is deprecated\n" +msgstr "Warnung: Dieser Syntax is veraltet.\n" + +#: command.c:159 +#, c-format +msgid "Invalid command \\%s. Try \\? for help.\n" +msgstr "Ungültiges Kommando \\%s. Versuchen Sie \\? für Hilfe.\n" + +#: command.c:161 +#, c-format +msgid "invalid command \\%s\n" +msgstr "ungültiges Kommando \\%s\n" + +#: command.c:278 +#, c-format +msgid "could not get home directory: %s\n" +msgstr "konnte Home-Verzeichnis nicht ermitteln: %s\n" + +#: command.c:292 +#, c-format +msgid "\\%s: could not change directory to '%s': %s\n" +msgstr "\\%s: konnte nicht in Verzeichnis »%s« wechseln: %s\n" + +#: command.c:380 command.c:726 +msgid "no query buffer\n" +msgstr "kein Abfragepuffer\n" + +#: command.c:436 +#, c-format +msgid "%s: invalid encoding name\n" +msgstr "" + +#: command.c:445 +#, c-format +msgid "\\%s: multi-byte support is not enabled\n" +msgstr "" + +#: command.c:499 command.c:530 command.c:541 command.c:555 command.c:597 +#: command.c:706 command.c:735 +#, c-format +msgid "\\%s: missing required argument\n" +msgstr "\\%s: notwendiges Argument fehlt\n" + +#: command.c:585 +msgid "Query buffer is empty." +msgstr "Abfragepuffer ist leer." + +#: command.c:616 +msgid "Query buffer reset (cleared)." +msgstr "Abfragepuffer wurde gelöscht." + +#: command.c:627 +#, c-format +msgid "Wrote history to %s.\n" +msgstr "History nach %s geschrieben.\n" + +#: command.c:668 command.c:900 command.c:1114 command.c:1160 command.c:1844 +#: common.c:57 copy.c:87 mainloop.c:80 mainloop.c:384 +msgid "out of memory\n" +msgstr "Speicher aufgebraucht\n" + +#: command.c:677 command.c:711 +#, c-format +msgid "\\%s: error\n" +msgstr "\\%s: Fehler\n" + +#: command.c:750 command.c:770 command.c:1005 command.c:1018 command.c:1028 +#: command.c:1501 command.c:1514 command.c:1526 command.c:1539 command.c:1553 +#: command.c:1567 command.c:1597 common.c:106 copy.c:290 +#, c-format +msgid "%s: %s\n" +msgstr "%s: %s\n" + +#: command.c:835 +#, c-format +msgid "\\%s: extra argument '%s' ignored\n" +msgstr "\\%s: überflüssiges Argument »%s« ignoriert\n" + +#: command.c:892 command.c:966 command.c:994 +msgid "parse error at end of line\n" +msgstr "Parse-Fehler am Zeilenende\n" + +#: command.c:1275 command.c:1299 startup.c:183 startup.c:201 +msgid "Password: " +msgstr "Paßwort: " + +#: command.c:1313 common.c:155 common.c:331 common.c:496 +#, c-format +msgid "%s" +msgstr "%s" + +#: command.c:1317 +msgid "Previous connection kept\n" +msgstr "Vorherige Verbindung wurde behalten\n" + +#: command.c:1330 +#, c-format +msgid "\\connect: %s" +msgstr "\\connect: %s" + +#: command.c:1342 +#, c-format +msgid "You are now connected to database %s.\n" +msgstr "Sie sind jetzt mit der Datenbank %s verbunden.\n" + +#: command.c:1344 +#, c-format +msgid "You are now connected as new user %s.\n" +msgstr "Sie sind jetzt als neuer Benutzer %s verbunden.\n" + +#: command.c:1347 +#, c-format +msgid "You are now connected to database %s as user %s.\n" +msgstr "Sie sind jetzt mit der Datenbank %s als Benutzer %s verbunden.\n" + +#: command.c:1438 +#, c-format +msgid "could not start editor %s\n" +msgstr "konnte Editor %s nicht starten\n" + +#: command.c:1440 +msgid "could not start /bin/sh\n" +msgstr "konnte /bin/sh nicht starten\n" + +#: command.c:1486 +#, c-format +msgid "couldn't open temp file %s: %s\n" +msgstr "" + +#: command.c:1670 +msgid "\\pset: allowed formats are unaligned, aligned, html, latex\n" +msgstr "\\pset: zulässige Formate sind unaligned, aligned, html, latex\n" + +#: command.c:1675 +#, c-format +msgid "Output format is %s.\n" +msgstr "Ausgabeformat ist »%s«.\n" + +#: command.c:1685 +#, c-format +msgid "Border style is %d.\n" +msgstr "Rahmenstil ist %d.\n" + +#: command.c:1694 +msgid "Expanded display is on.\n" +msgstr "Erweiterte Anzeige ist an.\n" + +#: command.c:1695 +msgid "Expanded display is off.\n" +msgstr "Erweiterte Anzeige ist aus.\n" + +#: command.c:1707 +#, c-format +msgid "Null display is '%s'.\n" +msgstr "Null-Anzeige ist »%s«.\n" + +#: command.c:1719 +#, c-format +msgid "Field separator is '%s'.\n" +msgstr "" + +#: command.c:1733 +msgid "Record separator is <newline>." +msgstr "" + +#: command.c:1735 +#, c-format +msgid "Record separator is '%s'.\n" +msgstr "" + +#: command.c:1746 +msgid "Showing only tuples." +msgstr "" + +#: command.c:1748 +msgid "Tuples only is off." +msgstr "" + +#: command.c:1764 +#, c-format +msgid "Title is \"%s\".\n" +msgstr "Titel ist »%s«.\n" + +#: command.c:1766 +msgid "Title is unset.\n" +msgstr "Titel ist nicht gesetzt.\n" + +#: command.c:1782 +#, c-format +msgid "Table attribute is \"%s\".\n" +msgstr "Tabellenattribut ist »%s«.\n" + +#: command.c:1784 +msgid "Table attributes unset.\n" +msgstr "Tabellenattribute sind nicht gesetzt.\n" + +#: command.c:1795 +msgid "Using pager is on." +msgstr "Pager-Verwendung is an." + +#: command.c:1797 +msgid "Using pager is off." +msgstr "Pager-Verwendung ist aus." + +#: command.c:1808 +msgid "Default footer is on." +msgstr "Standardfußzeile ist an." + +#: command.c:1810 +msgid "Default footer is off." +msgstr "Standardfußzeile ist aus." + +#: command.c:1816 +#, c-format +msgid "\\pset: unknown option: %s\n" +msgstr "\\pset: unbekannte Option: %s\n" + +#: command.c:1859 +msgid "\\!: failed\n" +msgstr "\\!: fehlgeschlagen\n" + +#: common.c:50 +#, c-format +msgid "%s: xstrdup: cannot duplicate null pointer (internal error)\n" +msgstr "" + +#: common.c:299 common.c:385 +msgid "You are currently not connected to a database.\n" +msgstr "Sie sind gegenwärtig nicht mit einer Datenbank verbunden.\n" + +#: common.c:338 common.c:506 +msgid "connection to server was lost\n" +msgstr "Verbindung zum Server wurde verloren\n" + +#: common.c:341 common.c:509 +msgid "The connection to the server was lost. Attempting reset: " +msgstr "Die Verbindung zum Server wurde verloren. Versuche Reset: " + +#: common.c:345 common.c:513 +msgid "Failed.\n" +msgstr "Fehlgeschlagen.\n" + +#: common.c:355 common.c:525 +msgid "Succeeded.\n" +msgstr "Erfolgreich.\n" + +#: common.c:393 +#, c-format +msgid "" +"***(Single step mode: Verify query)" +"*********************************************\n" +"%s\n" +"***(press return to proceed or enter x and return to cancel)" +"********************\n" +msgstr "" +"***(Einzelschrittmodus: Abfrage bestätigen)" +"*************************************\n" +"%s\n" +"***(Drücken Sie die Eingabetaste um fortzufahren oder »x« um abzubrechen)" +"*******\n" + +#: common.c:485 +msgid "" +"Enter data to be copied followed by a newline.\n" +"End with a backslash and a period on a line by itself." +msgstr "" + +#: common.c:531 +#, c-format +msgid "Asynchronous NOTIFY '%s' from backend with pid '%d' received.\n" +msgstr "" + +#: copy.c:81 +msgid "\\copy: arguments required\n" +msgstr "\\copy: benötigt Argumente\n" + +#: copy.c:211 +#, c-format +msgid "\\copy: parse error at '%s'\n" +msgstr "\\copy: Parse-Fehler bei '%s'\n" + +#: copy.c:213 +msgid "\\copy: parse error at end of line\n" +msgstr "\\copy: Parse-Fehler am Zeilenende\n" + +#: copy.c:310 +#, c-format +msgid "\\copy: %s" +msgstr "\\copy: %s" + +#: copy.c:314 +#, c-format +msgid "\\copy: unexpected response (%d)\n" +msgstr "\\copy: unerwartete Antwort (%d)\n" + +#: help.c:47 +msgid "on" +msgstr "an" + +#: help.c:47 +msgid "off" +msgstr "aus" + +#: help.c:70 +#, c-format +msgid "could not get current user name: %s\n" +msgstr "konnte aktuellen Benutzernamen nicht ermitteln: %s\n" + +#: help.c:79 +msgid "This is psql, the PostgreSQL interactive terminal.\n" +msgstr "Dies ist psql, das interaktive PostgreSQL-Terminal.\n" + +#: help.c:80 +msgid "Usage:" +msgstr "Benutzung:" + +#: help.c:81 +msgid " psql [options] [dbname [username]]\n" +msgstr " psql [Optionen] [DB-Name [Benutzername]]\n" + +#: help.c:82 +msgid "Options:" +msgstr "Optionen:" + +#: help.c:83 +msgid " -a Echo all input from script" +msgstr " -a Gib Skript-Inhalt wieder" + +#: help.c:84 +msgid " -A Unaligned table output mode (-P format=unaligned)" +msgstr "" + +#: help.c:85 +msgid " -c <query> Run only single query (or slash command) and exit" +msgstr " -c <Kommando> Führe einzelnes Kommando aus und beende" + +#: help.c:91 +#, c-format +msgid " -d <dbname> Specify database name to connect to (default: %s)\n" +msgstr "" +" -d <Dbname> Datenbank, zu der verbunden werden soll (Standard: %s)\n" + +#: help.c:93 +msgid " -e Echo queries sent to backend" +msgstr " -e Zeige Abfragen an den Server" + +#: help.c:94 +msgid " -E Display queries that internal commands generate" +msgstr "" +" -E Zeige Abfragen, die von internen Kommandos erzeugt werden" + +#: help.c:95 +msgid " -f <filename> Execute queries from file, then exit" +msgstr " -f <Dateiname> Führe Abfragen von Datei aus und beende danach" + +#: help.c:96 +#, c-format +msgid "" +" -F <string> Set field separator (default: \"%s\") (-P fieldsep=)\n" +msgstr "" + +#: help.c:101 +#, c-format +msgid " -h <host> Specify database server host (default: %s)\n" +msgstr " -h <Host> Hostname des Datenbankservers (Standard: %s)\n" + +#: help.c:102 +msgid "local socket" +msgstr "lokales Socket" + +#: help.c:104 +msgid " -H HTML table output mode (-P format=html)" +msgstr "" + +#: help.c:105 +msgid " -l List available databases, then exit" +msgstr " -l Zeige verfügbare Datenbanken und beende" + +#: help.c:106 +msgid " -n Disable readline" +msgstr " -n Schalte Readline aus" + +#: help.c:107 +msgid " -o <filename> Send query output to filename (or |pipe)" +msgstr "" + +#: help.c:111 +#, c-format +msgid " -p <port> Specify database server port (default: %s)\n" +msgstr "" + +#: help.c:114 +msgid "" +" -P var[=arg] Set printing option 'var' to 'arg' (see \\pset command)" +msgstr "" + +#: help.c:115 +msgid " -q Run quietly (no messages, only query output)" +msgstr "" + +#: help.c:116 +msgid "" +" -R <string> Set record separator (default: newline) (-P recordsep=)" +msgstr "" + +#: help.c:117 +msgid " -s Single step mode (confirm each query)" +msgstr "" + +#: help.c:118 +msgid " -S Single line mode (newline terminates query)" +msgstr "" + +#: help.c:119 +msgid " -t Print rows only (-P tuples_only)" +msgstr "" + +#: help.c:120 +msgid "" +" -T text Set HTML table tag options (width, border) (-P tableattr=)" +msgstr "" + +#: help.c:126 +#, c-format +msgid " -U <username> Specify database username (default: %s)\n" +msgstr " -U <Benutzer> Datenbank-Benutzername (Standard: %s)\n" + +#: help.c:128 +msgid " -v name=val Set psql variable 'name' to 'value'" +msgstr " -v Name=Wert Setze psql-Variable »Name« auf »Wert«" + +#: help.c:129 +msgid " -V Show version information and exit" +msgstr " -V Zeige Versionsinformationen und beende" + +#: help.c:130 +msgid " -W Prompt for password (should happen automatically)" +msgstr " -W Frage nach Paßwort (sollte automatisch passieren)" + +#: help.c:131 +msgid " -x Turn on expanded table output (-P expanded)" +msgstr " -x Schalte erweiterte Tabellenausgabe ein (-P expanded)" + +#: help.c:132 +msgid " -X Do not read startup file (~/.psqlrc)" +msgstr " -X Lese die Startdatei nicht (~/.psqlrc)" + +# XXX Da fehlt noch was. +#: help.c:135 +msgid "" +"\n" +"For more information, type \"\\?\" (for internal commands) or \"\\help\"\n" +"(for SQL commands) from within psql, or consult the psql section in\n" +"the PostgreSQL manual, which accompanies the distribution and is also\n" +"available at <http://www.postgresql.org>.\n" +"\n" +"Report bugs to <pgsql-bugs@postgresql.org>." +msgstr "" +"\n" +"Für mehr Informationen, geben Sie »\\?« (für interne Kommandos) oder\n" +"»\\help« (für SQL-Kommandos) in psql ein oder schauen Sie in den psql-\n" +"Abschnitt der PostgreSQL-Dokumentation.\n" +"\n" +"Berichten Sie Fehler an <pgsql-bugs@postgresql.org>." + +#: help.c:195 +msgid " \\a toggle between unaligned and aligned mode\n" +msgstr "" + +#: help.c:196 +#, c-format +msgid "" +" \\c[onnect] [dbname|- [user]]\n" +" connect to new database (currently '%s')\n" +msgstr "" + +#: help.c:199 +msgid " \\C <title> table title\n" +msgstr "" + +#: help.c:200 +msgid " \\cd [<dir>] change the current working directory\n" +msgstr "" + +#: help.c:201 +msgid "" +" \\copy ... perform SQL COPY with data stream to the client machine\n" +msgstr "" + +#: help.c:202 +msgid " \\copyright show PostgreSQL usage and distribution terms\n" +msgstr "" + +#: help.c:203 +msgid " \\d <table> describe table (or view, index, sequence)\n" +msgstr "" + +#: help.c:204 +msgid " \\d{t|i|s|v} list tables/indices/sequences/views\n" +msgstr "" + +#: help.c:205 +msgid " \\d{p|S|l} list permissions/system tables/lobjects\n" +msgstr "" + +#: help.c:206 +msgid " \\da list aggregates\n" +msgstr "" + +#: help.c:207 +msgid " \\dd [object] list comment for table, type, function, or operator\n" +msgstr "" + +#: help.c:208 +msgid " \\df list functions\n" +msgstr "" + +#: help.c:209 +msgid " \\do list operators\n" +msgstr "" + +#: help.c:210 +msgid " \\dT list data types\n" +msgstr "" + +#: help.c:211 +msgid "" +" \\e [file] edit the current query buffer or [file] with external " +"editor\n" +msgstr "" + +#: help.c:212 +msgid " \\echo <text> write text to stdout\n" +msgstr "" + +#: help.c:213 +msgid " \\encoding <encoding> set client encoding\n" +msgstr "" + +#: help.c:214 +msgid " \\f <sep> change field separator\n" +msgstr "" + +#: help.c:215 +msgid "" +" \\g [file] send query to backend (and results in [file] or |pipe)\n" +msgstr "" + +#: help.c:216 +msgid " \\h [cmd] help on syntax of sql commands, * for all commands\n" +msgstr "" + +#: help.c:217 +#, c-format +msgid " \\H toggle HTML mode (currently %s)\n" +msgstr "" + +#: help.c:219 +msgid " \\i <file> read and execute queries from <file>\n" +msgstr "" + +#: help.c:220 +msgid " \\l list all databases\n" +msgstr "" + +#: help.c:221 +msgid "" +" \\lo_export, \\lo_import, \\lo_list, \\lo_unlink\n" +" large object operations\n" +msgstr "" + +#: help.c:223 +msgid " \\o [file] send all query results to [file], or |pipe\n" +msgstr "" + +#: help.c:224 +msgid " \\p show the content of the current query buffer\n" +msgstr "" + +#: help.c:225 +msgid "" +" \\pset <opt> set table output <opt> = {format|border|expanded|" +"fieldsep|\n" +" null|recordsep|tuples_only|title|tableattr|pager}\n" +msgstr "" + +#: help.c:227 +msgid " \\q quit psql\n" +msgstr "" + +#: help.c:228 +msgid " \\qecho <text> write text to query output stream (see \\o)\n" +msgstr "" + +#: help.c:229 +msgid " \\r reset (clear) the query buffer\n" +msgstr "" + +#: help.c:230 +msgid " \\s [file] print history or save it in [file]\n" +msgstr "" + +#: help.c:231 +msgid " \\set <var> <value> set internal variable\n" +msgstr "" + +#: help.c:232 +#, c-format +msgid " \\t show only rows (currently %s)\n" +msgstr "" + +#: help.c:234 +msgid " \\T <tags> HTML table tags\n" +msgstr "" + +#: help.c:235 +msgid " \\unset <var> unset (delete) internal variable\n" +msgstr "" + +#: help.c:236 +msgid " \\w <file> write current query buffer to a <file>\n" +msgstr "" + +#: help.c:237 +#, c-format +msgid " \\x toggle expanded output (currently %s)\n" +msgstr "" + +#: help.c:239 +msgid " \\z list table access permissions\n" +msgstr "" + +#: help.c:240 +msgid " \\! [cmd] shell escape or command\n" +msgstr "" + +#: help.c:267 +msgid "Available help:" +msgstr "Verfügbare Hilfe:" + +#: help.c:298 +#, c-format +msgid "" +"Command: %s\n" +"Description: %s\n" +"Syntax:\n" +"%s\n" +"\n" +msgstr "" + +#: help.c:309 +#, c-format +msgid "" +"No help available for '%-.*s'.\n" +"Try \\h with no arguments to see available help.\n" +msgstr "" +"Keine Hilfe verfügbar für »%-.*s«.\n" +"Versuchen Sie \\h ohne Argumente, um die verfügbare Hilfe zu sehen.\n" + +#: input.c:171 +#, c-format +msgid "could not save history to %s: %s\n" +msgstr "konnte History nicht in %s speichern: %s\n" + +#: large_obj.c:66 +msgid "Warning: Your transaction in progress has been committed." +msgstr "Warnung: Die angefangene Transaktion wurde beendet (COMMIT)." + +#: large_obj.c:68 +msgid "Warning: Your transaction in progress has been rolled back." +msgstr "Warnung: Die angefangene Transaktion wurde abgebrochen." + +#: large_obj.c:95 +msgid "\\lo_export: not connected to a database\n" +msgstr "\\lo_export: nicht mit einer Datenbank verbunden\n" + +#: large_obj.c:162 +msgid "\\lo_import: not connected to a database\n" +msgstr "\\lo_import: nicht mit einer Datenbank verbunden\n" + +#: large_obj.c:253 +msgid "\\lo_unlink: not connected to a database\n" +msgstr "\\lo_unlink: nicht mit einer Datenbank verbunden\n" + +#: large_obj.c:328 +msgid "Description" +msgstr "Beschreibung" + +#: large_obj.c:336 +msgid "Large objects" +msgstr "" + +#: mainloop.c:242 +#, c-format +msgid "Use \"\\q\" to leave %s.\n" +msgstr "Verwenden Sie »\\q«, um %s zu verlassen.\n" + +#: print.c:367 +msgid "(No rows)\n" +msgstr "(Keine Zeilen)\n" + +#: print.c:1072 +msgid "(1 row)" +msgstr "(1 Zeile)" + +#: print.c:1074 +#, c-format +msgid "(%d rows)" +msgstr "(%d Zeilen)" + +#: startup.c:141 startup.c:615 +#, c-format +msgid "%s: out of memory\n" +msgstr "%s: Speicher aufgebraucht\n" + +#: startup.c:177 +msgid "Username: " +msgstr "Benutzername: " + +#: startup.c:286 +#, c-format +msgid "" +"Welcome to %s, the PostgreSQL interactive terminal.\n" +"\n" +"Type: \\copyright for distribution terms\n" +" \\h for help with SQL commands\n" +" \\? for help on internal slash commands\n" +" \\g or terminate with semicolon to execute query\n" +" \\q to quit\n" +"\n" +msgstr "" +"Willkommen bei %s, dem interaktiven PostgreSQL-Terminal.\n" +"\n" +"Geben Sie ein: \\copyright für Urheberrechtsinformationen\n" +" \\h für Hilfe über SQL-Kommandos\n" +" \\? für Hilfe über interne Kommandos\n" +" \\g oder Semikolon, um eine Abfrage auszuführen\n" +" \\q um zu beenden\n" +"\n" + +#: startup.c:461 +#, c-format +msgid "%s: couldn't set printing parameter %s\n" +msgstr "%s: konnte Ausgabeparameter %s nicht setzen\n" + +#: startup.c:507 +#, c-format +msgid "%s: could not delete variable %s\n" +msgstr "%s: konnte Variable %s nicht löschen\n" + +#: startup.c:517 +#, c-format +msgid "%s: could not set variable %s\n" +msgstr "%s: konnte Variable %s nicht setzen\n" + +#: startup.c:548 startup.c:563 +#, c-format +msgid "Try '%s --help' for more information.\n" +msgstr "Versuchen sie »%s --help« für weitere Informationen.\n" + +#: startup.c:556 +#, c-format +msgid "" +"%s was compiled without support for long options.\n" +"Use --help for help on invocation options.\n" +msgstr "" + +#: startup.c:581 +#, c-format +msgid "%s: warning: extra option %s ignored\n" +msgstr "%s: Warnung: überflüssige Option %s ignoriert\n" + +#: startup.c:588 +#, c-format +msgid "%s: Warning: The -u option is deprecated. Use -U.\n" +msgstr "%s: Warnung: The Option -u is veraltet. Verwenden Sie -U.\n" + +#: startup.c:644 +msgid "contains support for: " +msgstr "enthält Unterstützung für: " + +#: startup.c:647 +msgid "readline" +msgstr "readline" + +#: startup.c:657 +msgid "history" +msgstr "history" + +#: startup.c:666 +msgid "multibyte" +msgstr "multibyte" + +#: startup.c:674 +msgid "" +"Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group\n" +"Portions Copyright (c) 1996, Regents of the University of California\n" +"Read the file COPYRIGHT or use the command \\copyright to see the\n" +"usage and distribution terms." +msgstr "" +"Teile Copyright (c) 1996-2001, PostgreSQL Global Development Group\n" +"Teile Copyright (c) 1996, Regents of the University of California\n" +"Lesen Sie die Datei COPYRIGHT oder verwenden Sie das Kommando \\copyright\n" +"um Urheberrechtsinformationen zu sehen." + +#: startup.c:699 +#, c-format +msgid "" +"SSL connection (cipher: %s, bits: %i)\n" +"\n" +msgstr "" +"SSL-Verbindung (Verschlüsslungsmethode: %s, Bits: %i)\n" +"\n" diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index d5f15b5ba77..9f815c73c84 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.38 2001/05/07 19:31:33 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.39 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" #include "help.h" @@ -29,6 +29,8 @@ #include "common.h" #include "sql_help.h" +#define _(x) gettext((x)) + /* * PLEASE: * If you change something in this file, also make the same changes @@ -42,7 +44,7 @@ * * print out command line arguments */ -#define ON(var) (var ? "on" : "off") +#define ON(var) (var ? _("on") : _("off")) void usage(void) @@ -74,69 +76,67 @@ usage(void) } /* If this " is the start of the string then it ought to end there to fit in 80 columns >> " */ - puts("This is psql, the PostgreSQL interactive terminal.\n"); - puts("Usage:"); - puts(" psql [options] [dbname [username]]\n"); - puts("Options:"); - puts(" -a Echo all input from script"); - puts(" -A Unaligned table output mode (-P format=unaligned)"); - puts(" -c <query> Run only single query (or slash command) and exit"); + puts(_("This is psql, the PostgreSQL interactive terminal.\n")); + puts(_("Usage:")); + puts(_(" psql [options] [dbname [username]]\n")); + puts(_("Options:")); + puts(_(" -a Echo all input from script")); + puts(_(" -A Unaligned table output mode (-P format=unaligned)")); + puts(_(" -c <query> Run only single query (or slash command) and exit")); /* Display default database */ env = getenv("PGDATABASE"); if (!env) env = user; - printf(" -d <dbname> Specify database name to connect to (default: %s)\n", env); + printf(_(" -d <dbname> Specify database name to connect to (default: %s)\n"), env); - puts(" -e Echo queries sent to backend"); - puts(" -E Display queries that internal commands generate"); - puts(" -f <filename> Execute queries from file, then exit"); - puts(" -F <string> Set field separator (default: \"" DEFAULT_FIELD_SEP "\") (-P fieldsep=)"); + puts(_(" -e Echo queries sent to backend")); + puts(_(" -E Display queries that internal commands generate")); + puts(_(" -f <filename> Execute queries from file, then exit")); + printf(_(" -F <string> Set field separator (default: \"%s\") (-P fieldsep=)\n"), + DEFAULT_FIELD_SEP); /* Display default host */ env = getenv("PGHOST"); - printf(" -h <host> Specify database server host (default: "); - if (env) - fputs(env, stdout); - else - fputs("domain socket", stdout); - puts(")"); + printf(_(" -h <host> Specify database server host (default: %s)\n"), + env ? env : _("local socket")); - puts(" -H HTML table output mode (-P format=html)"); - puts(" -l List available databases, then exit"); - puts(" -n Disable readline"); - puts(" -o <filename> Send query output to filename (or |pipe)"); + puts(_(" -H HTML table output mode (-P format=html)")); + puts(_(" -l List available databases, then exit")); + puts(_(" -n Disable readline")); + puts(_(" -o <filename> Send query output to filename (or |pipe)")); /* Display default port */ env = getenv("PGPORT"); - printf(" -p <port> Specify database server port (default: %s)\n", - env ? env : "hardwired"); + printf(_(" -p <port> Specify database server port (default: %s)\n"), + env ? env : DEF_PGPORT_STR); - puts(" -P var[=arg] Set printing option 'var' to 'arg' (see \\pset command)"); - puts(" -q Run quietly (no messages, only query output)"); - puts(" -R <string> Set record separator (default: newline) (-P recordsep=)"); - puts(" -s Single step mode (confirm each query)"); - puts(" -S Single line mode (newline terminates query)"); - puts(" -t Print rows only (-P tuples_only)"); - puts(" -T text Set HTML table tag options (width, border) (-P tableattr=)"); + puts(_(" -P var[=arg] Set printing option 'var' to 'arg' (see \\pset command)")); + puts(_(" -q Run quietly (no messages, only query output)")); + puts(_(" -R <string> Set record separator (default: newline) (-P recordsep=)")); + puts(_(" -s Single step mode (confirm each query)")); + puts(_(" -S Single line mode (newline terminates query)")); + puts(_(" -t Print rows only (-P tuples_only)")); + puts(_(" -T text Set HTML table tag options (width, border) (-P tableattr=)")); /* Display default user */ env = getenv("PGUSER"); if (!env) env = user; - printf(" -U <username> Specify database username (default: %s)\n", env); - - puts(" -v name=val Set psql variable 'name' to 'value'"); - puts(" -V Show version information and exit"); - puts(" -W Prompt for password (should happen automatically)"); - puts(" -x Turn on expanded table output (-P expanded)"); - puts(" -X Do not read startup file (~/.psqlrc)"); - - puts("\nFor more information, type \"\\?\" (for internal commands) or \"\\help\""); - puts("(for SQL commands) from within psql, or consult the psql section in"); - puts("the PostgreSQL manual, which accompanies the distribution and is also"); - puts("available at <http://www.postgresql.org>."); - puts("Report bugs to <pgsql-bugs@postgresql.org>."); + printf(_(" -U <username> Specify database username (default: %s)\n"), env); + + puts(_(" -v name=val Set psql variable 'name' to 'value'")); + puts(_(" -V Show version information and exit")); + puts(_(" -W Prompt for password (should happen automatically)")); + puts(_(" -x Turn on expanded table output (-P expanded)")); + puts(_(" -X Do not read startup file (~/.psqlrc)")); + + puts(_( + "\nFor more information, type \"\\?\" (for internal commands) or \"\\help\"\n" + "(for SQL commands) from within psql, or consult the psql section in\n" + "the PostgreSQL manual, which accompanies the distribution and is also\n" + "available at <http://www.postgresql.org>.\n\n" + "Report bugs to <pgsql-bugs@postgresql.org>.")); } @@ -192,49 +192,52 @@ slashUsage(void) fout = stdout; /* if you add/remove a line here, change the row test above */ - fprintf(fout, " \\a toggle between unaligned and aligned mode\n"); - fprintf(fout, " \\c[onnect] [dbname|- [user]]\n" - " connect to new database (currently '%s')\n", PQdb(pset.db)); - fprintf(fout, " \\C <title> table title\n"); - fprintf(fout, " \\cd [<dir>] change the current working directory\n"); - fprintf(fout, " \\copy ... perform SQL COPY with data stream to the client machine\n"); - fprintf(fout, " \\copyright show PostgreSQL usage and distribution terms\n"); - fprintf(fout, " \\d <table> describe table (or view, index, sequence)\n"); - fprintf(fout, " \\d{t|i|s|v} list tables/indices/sequences/views\n"); - fprintf(fout, " \\d{p|S|l} list permissions/system tables/lobjects\n"); - fprintf(fout, " \\da list aggregates\n"); - fprintf(fout, " \\dd [object] list comment for table, type, function, or operator\n"); - fprintf(fout, " \\df list functions\n"); - fprintf(fout, " \\do list operators\n"); - fprintf(fout, " \\dT list data types\n"); - fprintf(fout, " \\e [file] edit the current query buffer or [file] with external editor\n"); - fprintf(fout, " \\echo <text> write text to stdout\n"); - fprintf(fout, " \\encoding <encoding> set client encoding\n"); - fprintf(fout, " \\f <sep> change field separator\n"); - fprintf(fout, " \\g [file] send query to backend (and results in [file] or |pipe)\n"); - fprintf(fout, " \\h [cmd] help on syntax of sql commands, * for all commands\n"); - fprintf(fout, " \\H toggle HTML mode (currently %s)\n", + fprintf(fout, _(" \\a toggle between unaligned and aligned mode\n")); + fprintf(fout, _(" \\c[onnect] [dbname|- [user]]\n" + " connect to new database (currently '%s')\n"), + PQdb(pset.db)); + fprintf(fout, _(" \\C <title> table title\n")); + fprintf(fout, _(" \\cd [<dir>] change the current working directory\n")); + fprintf(fout, _(" \\copy ... perform SQL COPY with data stream to the client machine\n")); + fprintf(fout, _(" \\copyright show PostgreSQL usage and distribution terms\n")); + fprintf(fout, _(" \\d <table> describe table (or view, index, sequence)\n")); + fprintf(fout, _(" \\d{t|i|s|v} list tables/indices/sequences/views\n")); + fprintf(fout, _(" \\d{p|S|l} list permissions/system tables/lobjects\n")); + fprintf(fout, _(" \\da list aggregates\n")); + fprintf(fout, _(" \\dd [object] list comment for table, type, function, or operator\n")); + fprintf(fout, _(" \\df list functions\n")); + fprintf(fout, _(" \\do list operators\n")); + fprintf(fout, _(" \\dT list data types\n")); + fprintf(fout, _(" \\e [file] edit the current query buffer or [file] with external editor\n")); + fprintf(fout, _(" \\echo <text> write text to stdout\n")); + fprintf(fout, _(" \\encoding <encoding> set client encoding\n")); + fprintf(fout, _(" \\f <sep> change field separator\n")); + fprintf(fout, _(" \\g [file] send query to backend (and results in [file] or |pipe)\n")); + fprintf(fout, _(" \\h [cmd] help on syntax of sql commands, * for all commands\n")); + fprintf(fout, _(" \\H toggle HTML mode (currently %s)\n"), ON(pset.popt.topt.format == PRINT_HTML)); - fprintf(fout, " \\i <file> read and execute queries from <file>\n"); - fprintf(fout, " \\l list all databases\n"); - fprintf(fout, " \\lo_export, \\lo_import, \\lo_list, \\lo_unlink\n" - " large object operations\n"); - fprintf(fout, " \\o [file] send all query results to [file], or |pipe\n"); - fprintf(fout, " \\p show the content of the current query buffer\n"); - fprintf(fout, " \\pset <opt> set table output <opt> = {format|border|expanded|fieldsep|\n" - " null|recordsep|tuples_only|title|tableattr|pager}\n"); - fprintf(fout, " \\q quit psql\n"); - fprintf(fout, " \\qecho <text> write text to query output stream (see \\o)\n"); - fprintf(fout, " \\r reset (clear) the query buffer\n"); - fprintf(fout, " \\s [file] print history or save it in [file]\n"); - fprintf(fout, " \\set <var> <value> set internal variable\n"); - fprintf(fout, " \\t show only rows (currently %s)\n", ON(pset.popt.topt.tuples_only)); - fprintf(fout, " \\T <tags> HTML table tags\n"); - fprintf(fout, " \\unset <var> unset (delete) internal variable\n"); - fprintf(fout, " \\w <file> write current query buffer to a <file>\n"); - fprintf(fout, " \\x toggle expanded output (currently %s)\n", ON(pset.popt.topt.expanded)); - fprintf(fout, " \\z list table access permissions\n"); - fprintf(fout, " \\! [cmd] shell escape or command\n"); + fprintf(fout, _(" \\i <file> read and execute queries from <file>\n")); + fprintf(fout, _(" \\l list all databases\n")); + fprintf(fout, _(" \\lo_export, \\lo_import, \\lo_list, \\lo_unlink\n" + " large object operations\n")); + fprintf(fout, _(" \\o [file] send all query results to [file], or |pipe\n")); + fprintf(fout, _(" \\p show the content of the current query buffer\n")); + fprintf(fout, _(" \\pset <opt> set table output <opt> = {format|border|expanded|fieldsep|\n" + " null|recordsep|tuples_only|title|tableattr|pager}\n")); + fprintf(fout, _(" \\q quit psql\n")); + fprintf(fout, _(" \\qecho <text> write text to query output stream (see \\o)\n")); + fprintf(fout, _(" \\r reset (clear) the query buffer\n")); + fprintf(fout, _(" \\s [file] print history or save it in [file]\n")); + fprintf(fout, _(" \\set <var> <value> set internal variable\n")); + fprintf(fout, _(" \\t show only rows (currently %s)\n"), + ON(pset.popt.topt.tuples_only)); + fprintf(fout, _(" \\T <tags> HTML table tags\n")); + fprintf(fout, _(" \\unset <var> unset (delete) internal variable\n")); + fprintf(fout, _(" \\w <file> write current query buffer to a <file>\n")); + fprintf(fout, _(" \\x toggle expanded output (currently %s)\n"), + ON(pset.popt.topt.expanded)); + fprintf(fout, _(" \\z list table access permissions\n")); + fprintf(fout, _(" \\! [cmd] shell escape or command\n")); if (usePipe) { @@ -261,7 +264,7 @@ helpSQL(const char *topic) int i; int items_per_column = (QL_HELP_COUNT + 2) / 3; - puts("Available help:"); + puts(_("Available help:")); for (i = 0; i < items_per_column; i++) { @@ -292,9 +295,9 @@ helpSQL(const char *topic) strcmp(topic, "*") == 0) { help_found = true; - printf("Command: %s\n" - "Description: %s\n" - "Syntax:\n%s\n\n", + printf(_("Command: %s\n" + "Description: %s\n" + "Syntax:\n%s\n\n"), QL_HELP[i].cmd, QL_HELP[i].help, QL_HELP[i].syntax); /* If we have an exact match, exit. Fixes \h SELECT */ if (strcasecmp(topic, QL_HELP[i].cmd) == 0) @@ -303,7 +306,7 @@ helpSQL(const char *topic) } if (!help_found) - printf("No help available for '%-.*s'.\nTry \\h with no arguments to see available help.\n", (int) len, topic); + printf(_("No help available for '%-.*s'.\nTry \\h with no arguments to see available help.\n"), (int) len, topic); } } diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c index 03004ef8d70..fe6a9cc4ec1 100644 --- a/src/bin/psql/large_obj.c +++ b/src/bin/psql/large_obj.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.14 2001/03/22 04:00:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.15 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" #include "large_obj.h" @@ -63,9 +63,9 @@ handle_transaction(void) else if (!QUIET()) { if (commit) - puts("Warning: Your transaction in progress has been committed."); + puts(gettext("Warning: Your transaction in progress has been committed.")); else - puts("Warning: Your transaction in progress has been rolled back."); + puts(gettext("Warning: Your transaction in progress has been rolled back.")); } PQsetNoticeProcessor(pset.db, old_notice_hook, NULL); @@ -92,9 +92,7 @@ do_lo_export(const char *loid_arg, const char *filename_arg) if (!pset.db) { - if (!pset.cur_cmd_interactive) - fprintf(stderr, "%s: ", pset.progname); - fputs("\\lo_export: not connected to a database\n", stderr); + psql_error("\\lo_export: not connected to a database\n"); return false; } @@ -161,9 +159,7 @@ do_lo_import(const char *filename_arg, const char *comment_arg) if (!pset.db) { - if (!pset.cur_cmd_interactive) - fprintf(stderr, "%s: ", pset.progname); - fputs("\\lo_import: not connected to a database\n", stderr); + psql_error("\\lo_import: not connected to a database\n"); return false; } @@ -254,9 +250,7 @@ do_lo_unlink(const char *loid_arg) if (!pset.db) { - if (!pset.cur_cmd_interactive) - fprintf(stderr, "%s: ", pset.progname); - fputs("\\lo_unlink: not connected to a database\n", stderr); + psql_error("\\lo_unlink: not connected to a database\n"); return false; } @@ -327,10 +321,11 @@ do_lo_list(void) char buf[1024]; printQueryOpt myopt = pset.popt; - strcpy(buf, - "SELECT loid as \"ID\", obj_description(loid) as \"Description\"\n" - "FROM (SELECT DISTINCT loid FROM pg_largeobject) x\n" - "ORDER BY \"ID\""); + snprintf(buf, sizeof(buf), + "SELECT loid as \"ID\", obj_description(loid) as \"%s\"\n" + "FROM (SELECT DISTINCT loid FROM pg_largeobject) x\n" + "ORDER BY \"ID\"", + gettext("Description")); res = PSQLexec(buf); if (!res) @@ -338,7 +333,7 @@ do_lo_list(void) myopt.topt.tuples_only = false; myopt.nullPrint = NULL; - myopt.title = "Large objects"; + myopt.title = gettext("Large objects"); printQuery(res, &myopt, pset.queryFout); diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index 1d5db855bb5..3c8e8ec268a 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.39 2001/03/26 15:18:51 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.40 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" #include "mainloop.h" @@ -19,7 +19,6 @@ #ifndef WIN32 #include <setjmp.h> sigjmp_buf main_loop_jmp; - #endif @@ -240,7 +239,7 @@ MainLoop(FILE *source) else { if (!QUIET()) - printf("Use \"\\q\" to leave %s.\n", pset.progname); + printf(gettext("Use \"\\q\" to leave %s.\n"), pset.progname); continue; } } diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk new file mode 100644 index 00000000000..0a1c7b55bab --- /dev/null +++ b/src/bin/psql/nls.mk @@ -0,0 +1,7 @@ +# $Header: /cvsroot/pgsql/src/bin/psql/nls.mk,v 1.1 2001/06/02 18:25:18 petere Exp $ +CATALOG_NAME := psql +AVAIL_LANGUAGES := de +GETTEXT_FILES := command.c common.c copy.c help.c input.c large_obj.c \ + mainloop.c print.c startup.c + # describe.c needs work +GETTEXT_TRIGGERS:= _ psql_error simple_prompt diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index a047a59eb31..9b89b5c5e39 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.19 2001/05/12 19:44:46 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.20 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" #include "print.h" @@ -364,7 +364,7 @@ print_aligned_vertical(const char *title, const char *const * headers, if (cells[0] == NULL) { - puts("(No rows)\n"); + puts(gettext("(No rows)\n")); return; } @@ -1069,9 +1069,9 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout) footers[0] = malloc(100); if (PQntuples(result) == 1) - strcpy(footers[0], "(1 row)"); + snprintf(footers[0], 100, gettext("(1 row)")); else - sprintf(footers[0], "(%d rows)", PQntuples(result)); + snprintf(footers[0], 100, gettext("(%d rows)"), PQntuples(result)); } else footers = NULL; diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index dc3396305d0..49e239a4fe1 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.49 2001/05/30 14:15:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.50 2001/06/02 18:25:18 petere Exp $ */ #include "postgres_fe.h" @@ -21,6 +21,10 @@ #include <getopt.h> #endif +#ifdef ENABLE_NLS +#include <locale.h> +#endif + #include "libpq-fe.h" #include "command.h" @@ -102,6 +106,12 @@ main(int argc, char *argv[]) char *password = NULL; bool need_pass; +#ifdef ENABLE_NLS + setlocale(LC_ALL, ""); + bindtextdomain("psql", LOCALEDIR); + textdomain("psql"); +#endif + if (!strrchr(argv[0], '/')) pset.progname = argv[0]; else @@ -128,7 +138,7 @@ main(int argc, char *argv[]) pset.vars = CreateVariableSpace(); if (!pset.vars) { - fprintf(stderr, "%s: out of memory\n", pset.progname); + fprintf(stderr, gettext("%s: out of memory\n"), pset.progname); exit(EXIT_FAILURE); } pset.popt.topt.format = PRINT_ALIGNED; @@ -273,12 +283,13 @@ main(int argc, char *argv[]) pset.issuper = test_superuser(PQuser(pset.db)); if (!QUIET() && !pset.notty) { - printf("Welcome to %s, the PostgreSQL interactive terminal.\n\n" - "Type: \\copyright for distribution terms\n" - " \\h for help with SQL commands\n" - " \\? for help on internal slash commands\n" - " \\g or terminate with semicolon to execute query\n" - " \\q to quit\n\n", pset.progname); + printf(gettext("Welcome to %s, the PostgreSQL interactive terminal.\n\n" + "Type: \\copyright for distribution terms\n" + " \\h for help with SQL commands\n" + " \\? for help on internal slash commands\n" + " \\g or terminate with semicolon to execute query\n" + " \\q to quit\n\n"), + pset.progname); #ifdef USE_SSL printSSLInfo(); #endif @@ -447,7 +458,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) if (!result) { - fprintf(stderr, "%s: couldn't set printing parameter %s\n", pset.progname, value); + fprintf(stderr, gettext("%s: couldn't set printing parameter %s\n"), pset.progname, value); exit(EXIT_FAILURE); } @@ -493,7 +504,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) { if (!DeleteVariable(pset.vars, value)) { - fprintf(stderr, "%s: could not delete variable %s\n", + fprintf(stderr, gettext("%s: could not delete variable %s\n"), pset.progname, value); exit(EXIT_FAILURE); } @@ -503,7 +514,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) *equal_loc = '\0'; if (!SetVariable(pset.vars, value, equal_loc + 1)) { - fprintf(stderr, "%s: could not set variable %s\n", + fprintf(stderr, gettext("%s: could not set variable %s\n"), pset.progname, value); exit(EXIT_FAILURE); } @@ -534,20 +545,22 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) /* unknown option reported by getopt */ else { - fprintf(stderr, "Try '%s --help' for more information.\n", + fprintf(stderr, gettext("Try '%s --help' for more information.\n"), pset.progname); exit(EXIT_FAILURE); } break; #ifndef HAVE_GETOPT_LONG case '-': - fprintf(stderr, "%s was compiled without support for long options.\n" - "Use --help for help on invocation options.\n", pset.progname); + fprintf(stderr, + gettext("%s was compiled without support for long options.\n" + "Use --help for help on invocation options.\n"), + pset.progname); exit(EXIT_FAILURE); break; #endif default: - fprintf(stderr, "Try '%s --help' for more information.\n", + fprintf(stderr, gettext("Try '%s --help' for more information.\n"), pset.progname); exit(EXIT_FAILURE); break; @@ -565,14 +578,14 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) else if (!options->username) options->username = argv[optind]; else if (!QUIET()) - fprintf(stderr, "%s: warning: extra option %s ignored\n", + fprintf(stderr, gettext("%s: warning: extra option %s ignored\n"), pset.progname, argv[optind]); optind++; } if (used_old_u_option && !QUIET()) - fprintf(stderr, "%s: Warning: The -u option is deprecated. Use -U.\n", pset.progname); + fprintf(stderr, gettext("%s: Warning: The -u option is deprecated. Use -U.\n"), pset.progname); } @@ -599,7 +612,7 @@ process_psqlrc(void) psqlrc = malloc(strlen(home) + 20); if (!psqlrc) { - fprintf(stderr, "%s: out of memory\n", pset.progname); + fprintf(stderr, gettext("%s: out of memory\n"), pset.progname); exit(EXIT_FAILURE); } @@ -628,10 +641,10 @@ showVersion(void) puts("psql (PostgreSQL) " PG_VERSION); #if defined(USE_READLINE) || defined (USE_HISTORY) || defined(MULTIBYTE) - fputs("contains ", stdout); + fputs(gettext("contains support for: "), stdout); #ifdef USE_READLINE - fputs("readline", stdout); + fputs(gettext("readline"), stdout); #define _Feature #endif @@ -641,7 +654,7 @@ showVersion(void) #else #define _Feature #endif - fputs("history", stdout); + fputs(gettext("history"), stdout); #endif #ifdef MULTIBYTE @@ -650,18 +663,18 @@ showVersion(void) #else #define _Feature #endif - fputs("multibyte", stdout); + fputs(gettext("multibyte"), stdout); #endif #undef _Feature - puts(" support"); + puts(""); #endif - puts("Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group"); - puts("Portions Copyright (c) 1996 Regents of the University of California"); - puts("Read the file COPYRIGHT or use the command \\copyright to see the"); - puts("usage and distribution terms."); + puts(gettext("Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group\n" + "Portions Copyright (c) 1996, Regents of the University of California\n" + "Read the file COPYRIGHT or use the command \\copyright to see the\n" + "usage and distribution terms.")); } @@ -683,7 +696,7 @@ printSSLInfo(void) return; /* no SSL */ SSL_get_cipher_bits(ssl, &sslbits); - printf("SSL enabled connection. Chiper: %s, bits: %i\n\n", + printf(gettext("SSL connection (cipher: %s, bits: %i)\n\n"), SSL_get_cipher(ssl), sslbits); } |