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.
This commit is contained in:
parent
58193c5f37
commit
e542036461
@ -1,4 +1,4 @@
|
||||
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.4 2001/02/10 22:31:42 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.5 2001/06/02 18:25:16 petere Exp $
|
||||
|
||||
|
||||
# PGAC_PATH_FLEX
|
||||
@ -99,3 +99,34 @@ if test "$pgac_cv_check_readline" != no ; then
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi])# PGAC_CHECK_READLINE
|
||||
|
||||
|
||||
|
||||
# PGAC_CHECK_GETTEXT
|
||||
# ------------------
|
||||
|
||||
AC_DEFUN([PGAC_CHECK_GETTEXT],
|
||||
[
|
||||
AC_SEARCH_LIBS(gettext, intl, [],
|
||||
[AC_MSG_ERROR([a gettext implementation is required for NLS])])
|
||||
AC_CHECK_HEADER([libintl.h], [],
|
||||
[AC_MSG_ERROR([header file <libintl.h> is required for NLS])])
|
||||
AC_CHECK_PROGS(MSGFMT, msgfmt)
|
||||
if test -z "$MSGFMT"; then
|
||||
AC_MSG_ERROR([msgfmt is required for NLS])
|
||||
fi
|
||||
AC_CHECK_PROGS(MSGMERGE, msgmerge)
|
||||
dnl FIXME: We should probably check for version >=0.10.36.
|
||||
AC_CHECK_PROGS(XGETTEXT, xgettext)
|
||||
|
||||
# Note: share/locale is always the default, independent of $datadir
|
||||
if test x"$prefix" = x"NONE"; then
|
||||
localedir="$ac_default_prefix/share/locale"
|
||||
else
|
||||
localedir="$prefix/share/locale"
|
||||
fi
|
||||
|
||||
AC_SUBST(localedir)
|
||||
AC_DEFINE_UNQUOTED(LOCALEDIR, ["$localedir"],
|
||||
[location of locale files])
|
||||
])# PGAC_CHECK_GETTEXT
|
||||
|
17
configure.in
17
configure.in
@ -212,6 +212,19 @@ AC_DEFINE([UNICODE_CONVERSION], 1,
|
||||
[Set to 1 if you want Unicode conversion support (--enable-unicode-conversion)])])
|
||||
AC_MSG_RESULT([$enable_unicode_conversion])
|
||||
|
||||
#
|
||||
# NLS
|
||||
#
|
||||
AC_MSG_CHECKING([whether NLS is wanted])
|
||||
PGAC_ARG_OPTARG(enable, nls,
|
||||
[ --enable-nls[=LANGUAGES] enable Native Language Support],
|
||||
[],
|
||||
[WANTED_LANGUAGES=$enableval],
|
||||
[AC_DEFINE(ENABLE_NLS)])
|
||||
AC_MSG_RESULT([$enable_nls])
|
||||
AC_SUBST(enable_nls)
|
||||
AC_SUBST(WANTED_LANGUAGES)
|
||||
|
||||
#
|
||||
# Default port number (--with-pgport), default 5432
|
||||
#
|
||||
@ -720,6 +733,10 @@ if test "$with_openssl" = yes ; then
|
||||
AC_CHECK_LIB(ssl, [SSL_library_init], [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
|
||||
fi
|
||||
|
||||
if test "$enable_nls" = yes ; then
|
||||
PGAC_CHECK_GETTEXT
|
||||
fi
|
||||
|
||||
|
||||
##
|
||||
## Header files
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/developer.sgml,v 1.4 2001/02/03 19:03:26 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/developer.sgml,v 1.5 2001/06/02 18:25:16 petere Exp $ -->
|
||||
<!-- PostgreSQL Developer's Guide -->
|
||||
|
||||
<book id="developer">
|
||||
@ -24,6 +24,7 @@
|
||||
&bki;
|
||||
&page;
|
||||
&geqo;
|
||||
&nls;
|
||||
<![%single-book;[
|
||||
&biblio;
|
||||
]]>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.12 2001/05/12 22:51:34 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.13 2001/06/02 18:25:16 petere Exp $ -->
|
||||
|
||||
<!entity history SYSTEM "history.sgml">
|
||||
<!entity info SYSTEM "info.sgml">
|
||||
@ -96,6 +96,7 @@
|
||||
<!entity page SYSTEM "page.sgml">
|
||||
<!entity protocol SYSTEM "protocol.sgml">
|
||||
<!entity sources SYSTEM "sources.sgml">
|
||||
<!entity nls SYSTEM "nls.sgml">
|
||||
|
||||
<!-- see standalone-install.sgml about these -->
|
||||
<!entity % flattext-install-ignore "INCLUDE">
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.49 2001/05/14 16:16:52 momjian Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.50 2001/06/02 18:25:16 petere Exp $ -->
|
||||
|
||||
<chapter id="installation">
|
||||
<title><![%flattext-install-include[<productname>PostgreSQL</>]]>
|
||||
@ -536,6 +536,44 @@ su - postgres
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--enable-nls<optional>=<replaceable>LANGUAGES</replaceable></optional></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Enables Native Language Support (NLS), that is, the ability
|
||||
to display a program's message in a language other than
|
||||
English. <replaceable>LANGUAGES</replaceable> is a space
|
||||
separated list of codes of the languages that you want
|
||||
supported. (The intersection between your list and the set
|
||||
of actually provided translations will be computed
|
||||
automatically.) If you do not specify it, then all available
|
||||
translations are installed.
|
||||
</para>
|
||||
|
||||
<comment>
|
||||
The list of provided translations should be shown somewhere.
|
||||
</comment>
|
||||
|
||||
<para>
|
||||
To use this option, you will need an implementation of the
|
||||
gettext API. Some operating systems have this built-in
|
||||
(e.g., Linux, NetBSD, Solaris), for other systems you can download
|
||||
an add-on package from here: <ulink
|
||||
url="http://www.postgresql.org/~petere/gettext.html"
|
||||
>http://www.postgresql.org/~petere/gettext.html</ulink>. If
|
||||
you are using the gettext implementation in the GNU C library
|
||||
then you will additionally need the GNU gettext package for
|
||||
some utility programs. For any of the other implementations
|
||||
you will not need it.
|
||||
</para>
|
||||
|
||||
<comment>
|
||||
The download location should be moved.
|
||||
</comment>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--with-pgport=<replaceable>NUMBER</></term>
|
||||
<listitem>
|
||||
|
486
doc/src/sgml/nls.sgml
Normal file
486
doc/src/sgml/nls.sgml
Normal file
@ -0,0 +1,486 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/nls.sgml,v 1.1 2001/06/02 18:25:16 petere Exp $ -->
|
||||
|
||||
<chapter id="nls">
|
||||
<docinfo>
|
||||
<author>
|
||||
<firstname>Peter</firstname>
|
||||
<surname>Eisentraut</surname>
|
||||
</author>
|
||||
</docinfo>
|
||||
|
||||
<title>Native Language Support</title>
|
||||
|
||||
<sect1 id="nls-translator">
|
||||
<title>For the Translator</title>
|
||||
|
||||
<para>
|
||||
PostgreSQL programs (server and client) can issue their messages in
|
||||
your favorite language -- if the messages have been translated.
|
||||
Creating and maintaining translated message sets needs the help of
|
||||
people who speak their own language well and want to contribute to
|
||||
the PostgreSQL effort. You do not have to be a programmer at all
|
||||
to do this. This section explains how to help.
|
||||
</para>
|
||||
|
||||
<sect2>
|
||||
<title>Requirements</title>
|
||||
|
||||
<para>
|
||||
We won't judge your language skills -- this section is about
|
||||
software tools. Theoretically, you only need a text editor. But
|
||||
this is only in the unlikely event that you do not want to try out
|
||||
your translated messages. When you configure your source tree, be
|
||||
sure to use the <option>--enable-nls</option> option. This will
|
||||
also check for the libintl library and the
|
||||
<filename>msgfmt</filename> program, which all end users will need
|
||||
anyway. To try out your work, follow the applicable portions of
|
||||
the installation instructions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you want to start a new translation effort or want to do a
|
||||
message catalog merge (described later), you will need the
|
||||
programs <filename>xgettext</filename> and
|
||||
<filename>msgmerge</filename>, respectively, in a GNU-compatible
|
||||
implementation. Later, we will try to arrange it so that if you
|
||||
use a packaged source distribution, you won't need
|
||||
<filename>xgettext</filename>. (From CVS, you will still need
|
||||
it.) GNU gettext 0.10.36 or later is currently recommended.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Your local gettext implementation should come with its own
|
||||
documentation. Some of that is probably duplicated in what
|
||||
follows, but for additional details you should look there.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Concepts</title>
|
||||
|
||||
<para>
|
||||
The pairs of original (English) messages and their (possibly)
|
||||
translated equivalents are kept in <firstterm>message
|
||||
catalogs</firstterm>, one for each program (although related
|
||||
programs can share a message catalog) and for each target
|
||||
language. There are two file formats for message catalogs: The
|
||||
first is the <quote>PO</quote> file (for Portable Object), which
|
||||
is a plain text file with special syntax that translators edit.
|
||||
The second is the <quote>MO</quote> file (for Machine Object),
|
||||
which is a binary file generated from the respective PO file and
|
||||
is used while the internationalized program is run. Translators
|
||||
do not deal with MO files; in fact hardly anyone does.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The extension of the message catalog file is to no surprise either
|
||||
<filename>.po</filename> or <filename>.mo</filename>. The base
|
||||
name is either the name of the program it accompanies, or the
|
||||
language the file is for, depending on the situation. This is a
|
||||
bit confusing. Examples are <filename>psql.po</filename> (PO file
|
||||
for psql) or <filename>fr.mo</filename> (MO file in French).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The file format of the PO files is illustrated here:
|
||||
<programlisting>
|
||||
# comment
|
||||
|
||||
msgid "original string"
|
||||
msgstr "translated string"
|
||||
|
||||
msgid "more original"
|
||||
msgstr "another translated"
|
||||
"string can be broken up like this"
|
||||
|
||||
...
|
||||
</programlisting>
|
||||
The msgid's are extracted from the program source. (They need not
|
||||
be, but this is the most common way.) The msgstr lines are
|
||||
initially empty and are filled in with useful strings by the
|
||||
translator. The strings can contain C-style escape characters and
|
||||
can be continued across lines as illustrated. (The next line must
|
||||
start at the beginning of the line.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The # character introduces a comment. If whitespace immediately
|
||||
follows the # character, then this is a comment maintained by the
|
||||
translator. There may also be automatic comments, which have a
|
||||
non-whitespace character immediately following the #. These are
|
||||
maintained by the various tools that operate on the PO files and
|
||||
are intended to aid the translator.
|
||||
<programlisting>
|
||||
#. automatic comment
|
||||
#: filename.c:1023
|
||||
#, flags, flags
|
||||
</programlisting>
|
||||
The #. style comments are extracted from the source file where the
|
||||
message is used. Possibly the programmer has inserted information
|
||||
for the translator, such as about expected alignment. The #:
|
||||
comment indicates the exact location(s) where the message is used
|
||||
in the source. The translator need not look at the program
|
||||
source, but he can if there is doubt about the correct
|
||||
translation. The #, comments contain flags that describe the
|
||||
message in some way. There are currently two flags:
|
||||
<literal>fuzzy</literal> is set if the message has possibly been
|
||||
outdated because of changes in the program source. The translator
|
||||
can then verify this and possibly remove the fuzzy flag. Note
|
||||
that fuzzy messages are not made available to the end user. The
|
||||
other flag is <literal>c-format</literal>, which indicates that
|
||||
the message is a <function>printf</function>-style format
|
||||
template. This means that the translation should also be a format
|
||||
string with the same number and type of placeholders. There are
|
||||
tools that can verify this, which key off the c-format flag.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Creating and maintaining message catalogs</title>
|
||||
|
||||
<para>
|
||||
Okay, so how does one create a <quote>blank</quote> message
|
||||
catalog? First, go into the directory that contains the program
|
||||
whose messages you want to translate. If there is a file
|
||||
<filename>nls.mk</filename>, then this program has been prepared
|
||||
for translation.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If there are already some <filename>.po</filename> files, then
|
||||
someone has already done some translation work. The files are
|
||||
named <filename><replaceable>language</replaceable>.po</filename>,
|
||||
where <replaceable>language</replaceable> is the <ulink
|
||||
url="http://lcweb.loc.gov/standards/iso639-2/englangn.html">ISO
|
||||
639-1</ulink> two-letter language code (in lower case), e.g.,
|
||||
<filename>fr.po</filename> for French. If there is really a need
|
||||
for more than one translation effort per language then the files
|
||||
may also be named
|
||||
<filename><replaceable>language</replaceable>_<replaceable>region</replaceable>.po</filename>
|
||||
where <replaceable>region</replaceable> is the <ulink
|
||||
url="http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html">ISO
|
||||
3166-1</ulink> two-letter country code (in upper case), e.g.,
|
||||
<filename>pt_BR.po</filename> for Portuguese in Brazil. If you
|
||||
find the language you wanted you can just start working on that
|
||||
file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you need to start a new translation effort, then first run the
|
||||
command
|
||||
<programlisting>
|
||||
gmake init-po
|
||||
</programlisting>
|
||||
This will create a file
|
||||
<filename><replaceable>progname</replaceable>.pot</filename>.
|
||||
(<filename>.pot</filename> to distinguish it from PO files that
|
||||
are <quote>in production</quote>. What does the T stand for? I
|
||||
don't know.) Copy this file to
|
||||
<filename><replaceable>language</replaceable>.po</filename> and
|
||||
edit it. To make it known that the new language is available,
|
||||
also edit the file <filename>nls.mk</filename> and add the
|
||||
language (or language and country) code to the line that looks like:
|
||||
<programlisting>
|
||||
AVAIL_LANGUAGES := de fr
|
||||
</programlisting>
|
||||
(Other languages may appear, of course.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As the underlying program or library changes, messages may be
|
||||
changed or added by the programmers. In this case you do not need
|
||||
to start from scratch. Instead, run the command
|
||||
<programlisting>
|
||||
gmake update-po
|
||||
</programlisting>
|
||||
which will create a new blank message catalog file (the pot file
|
||||
you started with) and will merge it with the existing PO files.
|
||||
If the merge algorithm is not sure about a particular message it
|
||||
marks it <quote>fuzzy</quote> as explained above. For the case
|
||||
where something went really wrong, the old PO file is saved with a
|
||||
<filename>.po.old</filename> extension.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Editing the PO files</title>
|
||||
|
||||
<para>
|
||||
The PO files can be edited with a regular text editor. The
|
||||
translator should only change the area between the quotes after
|
||||
the msgstr directive, may add comments and alter the fuzzy flag.
|
||||
There is (unsurprisingly) a PO mode for Emacs, which I find quite
|
||||
useful.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The PO files need not be completely filled in. The software will
|
||||
automatically fall back to the original string if no translation
|
||||
(or an empty translation) is available. It is no problem to
|
||||
submit incomplete translations for inclusions in the source tree;
|
||||
that gives room for other people to pick up your work. However,
|
||||
you are encouraged to give priority to removing fuzzy entries
|
||||
after doing a merge. Remember that fuzzy entries will not be
|
||||
installed; they only serve as reference what might be the right
|
||||
translation.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Here are some things to keep in mind while editing the
|
||||
translations:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Make sure that if the original ends with a newline, the
|
||||
translation does, too. Similarly for tabs, etc.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
If the original is a printf format string, the translation also
|
||||
needs to be. The translation also needs to have the same
|
||||
format specifiers in the same order. Sometimes the natural
|
||||
rules of the language make this impossible or at least awkward.
|
||||
In this case you can use this format:
|
||||
<programlisting>
|
||||
msgstr "Die Datei %2$s hat %1$u Zeichen."
|
||||
</programlisting>
|
||||
Then the first placeholder will actually use the second
|
||||
argument from the list. The
|
||||
<literal><replaceable>digits</replaceable>$</literal> needs to
|
||||
follow the % and come before any other format manipulators.
|
||||
(This feature really exists in the <function>printf</function>
|
||||
family of functions. You may not have heard of it because
|
||||
there is little use for it outside of message
|
||||
internationalization.)
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
If the original string contains a linguistic mistake, report
|
||||
that (or fix it yourself in the program source) and translate
|
||||
normally. The corrected string can be merged in when the
|
||||
program sources have been updated. If the original string
|
||||
contains a factual mistake, report that (or fix it yourself)
|
||||
and do not translate it. Instead, you may mark the string with
|
||||
a comment in the PO file.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Maintain the style and tone of the original string.
|
||||
Specifically, messages that are not sentences (<literal>cannot
|
||||
open file %s</literal>) should probably not start with a
|
||||
capital letter (if your language distinguishes letter case) or
|
||||
end with a period (if your language uses punctuation marks).
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
If you don't know what a message means, or if it is ambiguous,
|
||||
ask on the developers' mailing list. Chances are that English
|
||||
speaking end users might also not understand it or find it
|
||||
ambiguous, so it's best to improve the message.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
||||
<sect1 id="nls-programmer">
|
||||
<title>For the Programmer</title>
|
||||
|
||||
<para>
|
||||
This section describes how to support native language support in a
|
||||
program or library that is part of the PostgreSQL distribution.
|
||||
Currently, it only applies to C programs.
|
||||
</para>
|
||||
|
||||
<procedure>
|
||||
<title>Adding NLS support to a program</title>
|
||||
|
||||
<step>
|
||||
<para>
|
||||
Insert this code into the startup sequence of the program:
|
||||
<programlisting>
|
||||
#ifdef ENABLE_NLS
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
...
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain("<replaceable>progname</replaceable>", LOCALEDIR);
|
||||
textdomain("<replaceable>progname</replaceable>");
|
||||
#endif
|
||||
</programlisting>
|
||||
(The <replaceable>progname</replaceable> can actually be chosen
|
||||
freely.)
|
||||
</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>
|
||||
Whereever a message that is a candidate for translation is found,
|
||||
a call to <function>gettext()</function> needs to be inserted. E.g.,
|
||||
<programlisting>
|
||||
fprintf(stderr, "panic level %d\n", lvl);
|
||||
</programlisting>
|
||||
would be changed to
|
||||
<programlisting>
|
||||
fprintf(stderr, gettext("panic level %d\n"), lvl);
|
||||
</programlisting>
|
||||
(<symbol>gettext</symbol> is defined as a no-op if no NLS is
|
||||
configured.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This may tend to add a lot of clutter. One common shortcut is to
|
||||
<programlisting>
|
||||
#define _(x) gettext((x))
|
||||
</programlisting>
|
||||
Another solution is feasible if the program does much of its
|
||||
communication through one or a few functions, such as
|
||||
<function>elog()</function> in the backend. Then you make this
|
||||
function call <function>gettext</function> internally on all
|
||||
input values.
|
||||
</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>
|
||||
Add a file <filename>nls.mk</filename> in the directory with the
|
||||
program sources. This file will be read as a makefile. The
|
||||
following variable assignments need to be made here:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>CATALOG_NAME</term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The program name, as provided in the
|
||||
<function>textdomain()</function> call.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>AVAIL_LANGUAGES</term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
List of provided translations -- empty in the beginning.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GETTEXT_FILES</term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
List of files that contain translatable strings, i.e., those
|
||||
marked with <function>gettext</function> or an alternative
|
||||
solution. Eventually, this will include nearly all source
|
||||
files of the program. If this list gets too long you can
|
||||
make the first <quote>file</quote> be a <literal>+</literal>
|
||||
and the second word be a file that contains one file name per
|
||||
line.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GETTEXT_TRIGGERS</term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The tools that generate message catalogs for the translators
|
||||
to work on need to know what function calls contain
|
||||
translatable strings. By default, only
|
||||
<function>gettext()</function> calls are known. If you used
|
||||
<function>_</function> or other identifiers you need to list
|
||||
them here. If the translatable string is not the first
|
||||
argument, the item needs to be of the form
|
||||
<literal>func:2</literal> (for the second argument).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</step>
|
||||
|
||||
</procedure>
|
||||
|
||||
<para>
|
||||
The build system will automatically take care of building and
|
||||
installing the message catalogs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To ease the translation of messages, here are some guidelines:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not construct sentences at run-time out of laziness, like
|
||||
<programlisting>
|
||||
printf("Files where %s.\n", flag ? "copied" : "removed");
|
||||
</programlisting>
|
||||
The word order within the sentence may be different in other
|
||||
languages.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
For similar reasons, this won't work:
|
||||
<programlisting>
|
||||
printf("copied %d file%s", n, n!=1 ? "s" : "");
|
||||
</programlisting>
|
||||
because it assumes how the plural is formed. If you figured you
|
||||
could solve it like this
|
||||
<programlisting>
|
||||
if (n==1)
|
||||
printf("copied 1 file");
|
||||
else
|
||||
printf("copied %d files", n):
|
||||
</programlisting>
|
||||
then be disappointed. Some languages have more than two forms,
|
||||
with some peculiar rules. We may have a solution for this in
|
||||
the future, but for now this is best avoided altogether. You
|
||||
could write:
|
||||
<programlisting>
|
||||
printf("number of copied files: %d", n);
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
If you want to communicate something to the translator, such as
|
||||
about how a message is intended to line up with other output,
|
||||
precede the occurance of the string with a comment that starts
|
||||
with <literal>translator</literal>, e.g.,
|
||||
<programlisting>
|
||||
/* translator: This message is not what it seems to be. */
|
||||
</programlisting>
|
||||
These comments are copied to the message catalog files so that
|
||||
the translators can see them.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
@ -1,5 +1,5 @@
|
||||
# -*-makefile-*-
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.128 2001/05/25 14:28:58 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.129 2001/06/02 18:25:16 petere Exp $
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# All PostgreSQL makefiles include this file and use the variables it sets,
|
||||
@ -18,7 +18,7 @@
|
||||
#
|
||||
# Meta configuration
|
||||
|
||||
.PHONY: all install installdirs uninstall clean distclean maintainer-clean distprep check installcheck
|
||||
.PHONY: all install installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
|
||||
.SILENT: installdirs
|
||||
|
||||
# make `all' the default target
|
||||
@ -100,6 +100,7 @@ endif
|
||||
odbcinst_ini_dir = @odbcinst_ini_dir@
|
||||
|
||||
javadir := $(DESTDIR)$(datadir)/java
|
||||
localedir := @localedir@
|
||||
|
||||
|
||||
##########################################################################
|
||||
@ -119,6 +120,7 @@ enable_odbc = @enable_odbc@
|
||||
MULTIBYTE = @MULTIBYTE@
|
||||
enable_shared = @enable_shared@
|
||||
enable_rpath = @enable_rpath@
|
||||
enable_nls = @enable_nls@
|
||||
|
||||
python_version = @python_version@
|
||||
python_includedir = @python_includedir@
|
||||
@ -186,10 +188,13 @@ X = @EXEEXT@
|
||||
ANT = @ANT@
|
||||
AWK = @AWK@
|
||||
LN_S = @LN_S@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
PERL = @PERL@
|
||||
PYTHON = @PYTHON@
|
||||
TAR = @TAR@
|
||||
WISH = @WISH@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
|
||||
# Installation.
|
||||
|
||||
@ -214,6 +219,7 @@ SGMLSPL = @SGMLSPL@
|
||||
# Feature settings
|
||||
|
||||
DEF_PGPORT = @default_port@
|
||||
WANTED_LANGUAGES = @WANTED_LANGUAGES@
|
||||
|
||||
|
||||
##########################################################################
|
||||
@ -411,3 +417,16 @@ clean-deps:
|
||||
@rm -rf $(DEPDIR) *.d
|
||||
|
||||
endif # autodepend
|
||||
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# Native language support
|
||||
|
||||
ifeq ($(enable_nls), yes)
|
||||
ifneq (,$(wildcard $(srcdir)/nls.mk))
|
||||
|
||||
include $(top_srcdir)/src/nls-global.mk
|
||||
|
||||
endif # nls.mk
|
||||
endif # enable_nls
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Copyright (c) 1994, Regents of the University of California
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.72 2001/05/24 15:53:32 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.73 2001/06/02 18:25:17 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -34,6 +34,9 @@ endif
|
||||
##########################################################################
|
||||
|
||||
all: postgres $(POSTGRES_IMP)
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po all
|
||||
endif
|
||||
|
||||
ifneq ($(PORTNAME), win)
|
||||
|
||||
@ -113,7 +116,9 @@ distprep:
|
||||
$(MAKE) -C parser gram.c parse.h scan.c
|
||||
$(MAKE) -C bootstrap bootparse.c bootstrap_tokens.h bootscanner.c
|
||||
$(MAKE) -C utils/misc guc-file.c
|
||||
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
||||
##########################################################################
|
||||
|
||||
@ -127,9 +132,15 @@ endif
|
||||
$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample
|
||||
$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample
|
||||
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(datadir)
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
||||
install-bin: postgres $(POSTGRES_IMP) installdirs
|
||||
$(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X)
|
||||
@ -157,6 +168,9 @@ endif
|
||||
rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \
|
||||
$(DESTDIR)$(datadir)/pg_ident.conf.sample \
|
||||
$(DESTDIR)$(datadir)/postgresql.conf.sample
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
||||
|
||||
##########################################################################
|
||||
@ -171,6 +185,9 @@ ifeq ($(MAKE_DLL), true)
|
||||
endif
|
||||
endif
|
||||
for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done
|
||||
ifeq ($(enable_nls), yes)
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
||||
distclean: clean
|
||||
rm -f port/Makefile port/tas.s port/dynloader.c
|
||||
@ -183,6 +200,7 @@ maintainer-clean: distclean
|
||||
$(srcdir)/parser/scan.c \
|
||||
$(srcdir)/parser/parse.h \
|
||||
$(srcdir)/utils/misc/guc-file.c
|
||||
$(MAKE) -C po maintainer-clean
|
||||
|
||||
|
||||
##########################################################################
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.43 2001/04/21 18:29:29 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.44 2001/06/02 18:25:17 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#ifdef USE_LOCALE
|
||||
#if defined(USE_LOCALE) || defined(ENABLE_NLS)
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
@ -97,6 +97,14 @@ main(int argc, char *argv[])
|
||||
beos_startup(argc, argv);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#ifdef LC_MESSAGES
|
||||
setlocale(LC_MESSAGES, "");
|
||||
#endif
|
||||
bindtextdomain("postgres", LOCALEDIR);
|
||||
textdomain("postgres");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Not-quite-so-platform-specific startup environment checks. Still
|
||||
* best to minimize these.
|
||||
|
12
src/backend/po/Makefile
Normal file
12
src/backend/po/Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
# $Header: /cvsroot/pgsql/src/backend/po/Attic/Makefile,v 1.1 2001/06/02 18:25:17 petere Exp $
|
||||
|
||||
subdir = src/backend/po
|
||||
top_builddir = ../../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
|
||||
|
||||
gettext-files:
|
||||
find $(srcdir)/.. -name '*.c' >$@
|
||||
|
||||
maintainer-clean:
|
||||
rm -f gettext-files
|
11339
src/backend/po/de.po
Normal file
11339
src/backend/po/de.po
Normal file
File diff suppressed because it is too large
Load Diff
4
src/backend/po/nls.mk
Normal file
4
src/backend/po/nls.mk
Normal file
@ -0,0 +1,4 @@
|
||||
CATALOG_NAME := postgres
|
||||
AVAIL_LANGUAGES := de
|
||||
GETTEXT_FILES := + gettext-files
|
||||
GETTEXT_TRIGGERS:= elog:2
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.84 2001/05/30 14:15:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.85 2001/06/02 18:25:17 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -207,6 +207,7 @@ elog(int lev, const char *fmt,...)
|
||||
if (Log_pid)
|
||||
timestamp_size += PID_SIZE;
|
||||
|
||||
fmt = gettext(fmt);
|
||||
/*
|
||||
* Set up the expanded format, consisting of the prefix string plus
|
||||
* input format, with any %m replaced by strerror() string (since
|
||||
|
@ -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."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
827
src/bin/psql/de.po
Normal file
827
src/bin/psql/de.po
Normal file
@ -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"
|
@ -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);
|
||||
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(_(" -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>.");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
7
src/bin/psql/nls.mk
Normal file
7
src/bin/psql/nls.mk
Normal file
@ -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
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: c.h,v 1.93 2001/05/30 14:15:27 momjian Exp $
|
||||
* $Id: c.h,v 1.94 2001/06/02 18:25:18 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -68,6 +68,11 @@
|
||||
#include <SupportDefs.h>
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#else
|
||||
#define gettext(x) (x)
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* Section 1: hacks to cope with non-ANSI C compilers
|
||||
|
@ -8,7 +8,7 @@
|
||||
* or in config.h afterwards. Of course, if you edit config.h, then your
|
||||
* changes will be overwritten the next time you run configure.
|
||||
*
|
||||
* $Id: config.h.in,v 1.164 2001/05/11 23:38:06 petere Exp $
|
||||
* $Id: config.h.in,v 1.165 2001/06/02 18:25:18 petere Exp $
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
@ -84,6 +84,11 @@
|
||||
/* --enable-pltcl-unknown */
|
||||
#undef ENABLE_PLTCL_UNKNOWN
|
||||
|
||||
/* --enable-nls */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* location of locale files */
|
||||
#undef LOCALEDIR
|
||||
|
||||
/*
|
||||
*------------------------------------------------------------------------
|
||||
|
119
src/nls-global.mk
Normal file
119
src/nls-global.mk
Normal file
@ -0,0 +1,119 @@
|
||||
# $Header: /cvsroot/pgsql/src/nls-global.mk,v 1.1 2001/06/02 18:25:17 petere Exp $
|
||||
|
||||
# Common rules for Native Language Support (NLS)
|
||||
#
|
||||
# If some subdirectory of the source tree wants to provide NLS, it
|
||||
# needs to contain a file 'nls.mk' with the following make variable
|
||||
# assignments:
|
||||
#
|
||||
# CATALOG_NAME -- name of the message catalog (xxx.po); probably
|
||||
# name of the program
|
||||
# AVAIL_LANGUAGES -- list of languages that are provided/supported
|
||||
# GETTEXT_FILES -- list of source files that contain message strings
|
||||
# GETTEXT_TRIGGERS -- (optional) list of functions that contain
|
||||
# translatable strings
|
||||
#
|
||||
# That's all, the rest is done here, if --enable-nls was specified.
|
||||
#
|
||||
# The only user-visible targets here are 'init-po', to make an initial
|
||||
# "blank" catalog from program sources, and 'update-po', which is to
|
||||
# be called if the messages in the program source have changed, in
|
||||
# order to merge the changes into the existing .po files.
|
||||
|
||||
|
||||
# existence checked by Makefile.global; otherwise we won't get here
|
||||
include $(srcdir)/nls.mk
|
||||
|
||||
# If user specified the languages he wants in --enable-nls=LANGUAGES,
|
||||
# filter out the rest. Else use all available ones.
|
||||
ifdef WANTED_LANGUAGES
|
||||
LANGUAGES = $(filter $(WANTED_LANGUAGES), $(AVAIL_LANGUAGES))
|
||||
else
|
||||
LANGUAGES = $(AVAIL_LANGUAGES)
|
||||
endif
|
||||
|
||||
PO_FILES = $(addsuffix .po, $(LANGUAGES))
|
||||
MO_FILES = $(addsuffix .mo, $(LANGUAGES))
|
||||
|
||||
XGETTEXT += --foreign-user
|
||||
|
||||
|
||||
all-po: $(MO_FILES)
|
||||
|
||||
distprep: $(srcdir)/$(CATALOG_NAME).pot
|
||||
|
||||
%.mo: %.po
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
ifdef XGETTEXT
|
||||
ifeq ($(word 1,$(GETTEXT_FILES)),+)
|
||||
$(srcdir)/$(CATALOG_NAME).pot: $(word 2, $(GETTEXT_FILES))
|
||||
$(XGETTEXT) -D $(srcdir) -ctranslator -n $(addprefix -k, $(GETTEXT_TRIGGERS)) -f $<
|
||||
else
|
||||
$(srcdir)/$(CATALOG_NAME).pot: $(GETTEXT_FILES)
|
||||
$(XGETTEXT) -ctranslator -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $^
|
||||
endif
|
||||
mv messages.po $@
|
||||
else # not XGETTEXT
|
||||
@echo "You don't have 'xgettext'."; exit 1
|
||||
endif # not XGETTEXT
|
||||
|
||||
|
||||
install-po: all-po installdirs-po
|
||||
for lang in $(LANGUAGES); do \
|
||||
$(INSTALL_DATA) $$lang.mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo || exit 1; \
|
||||
done
|
||||
|
||||
installdirs-po:
|
||||
$(mkinstalldirs) $(foreach lang, $(LANGUAGES), $(DESTDIR)$(localedir)/$(lang)/LC_MESSAGES)
|
||||
|
||||
uninstall-po:
|
||||
rm -f $(foreach lang, $(LANGUAGES), $(DESTDIR)$(localedir)/$(lang)/LC_MESSAGES/$(CATALOG_NAME).mo)
|
||||
|
||||
|
||||
clean-po:
|
||||
rm -f $(MO_FILES)
|
||||
@rm -f $(addsuffix .po.old, $(AVAIL_LANGUAGES))
|
||||
|
||||
maintainer-clean-po:
|
||||
rm -f $(srcdir)/$(CATALOG_NAME).pot
|
||||
|
||||
|
||||
maintainer-check-po: $(PO_FILES)
|
||||
for file in $^; do \
|
||||
$(MSGFMT) -v -o /dev/null $$file || exit 1; \
|
||||
done
|
||||
|
||||
|
||||
init-po: $(srcdir)/$(CATALOG_NAME).pot
|
||||
|
||||
|
||||
update-po: $(srcdir)/$(CATALOG_NAME).pot
|
||||
ifdef MSGMERGE
|
||||
# XXX should be $(LANGUAGES)?
|
||||
@for lang in $(AVAIL_LANGUAGES); do \
|
||||
echo "merging $$lang:"; \
|
||||
if $(MSGMERGE) $(srcdir)/$$lang.po $< -o $$lang.po.new; \
|
||||
then \
|
||||
mv $(srcdir)/$$lang.po $$lang.po.old; \
|
||||
mv $$lang.po.new $(srcdir)/$$lang.po; \
|
||||
else \
|
||||
echo "msgmerge for $$lang failed"; \
|
||||
rm -f $$lang.po.new; \
|
||||
fi; \
|
||||
done
|
||||
else
|
||||
@echo "You don't have 'msgmerge'." ; exit 1
|
||||
endif
|
||||
|
||||
|
||||
all: all-po
|
||||
install: install-po
|
||||
installdirs: installdirs-po
|
||||
uninstall: uninstall-po
|
||||
clean distclean: clean-po
|
||||
maintainer-clean: maintainer-clean-po
|
||||
maintainer-check: maintainer-check-po
|
||||
|
||||
.PHONY: all-po install-po installdirs-po uninstall-po clean-po \
|
||||
maintainer-clean-po maintainer-check-po init-po update-po
|
Loading…
x
Reference in New Issue
Block a user