aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/connect.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2009-01-15 11:52:55 +0000
committerPeter Eisentraut <peter_e@gmx.net>2009-01-15 11:52:55 +0000
commitcb05ab81a857582161dd74cbfa91d4468e496cd1 (patch)
treed9808e4df13a70e2cb6f68fd09a059fa54170a7d /src/interfaces/ecpg/ecpglib/connect.c
parentcbb1358b18c88216a56de8847428d1bbcc51f280 (diff)
downloadpostgresql-cb05ab81a857582161dd74cbfa91d4468e496cd1.tar.gz
postgresql-cb05ab81a857582161dd74cbfa91d4468e496cd1.zip
NLS cleanup in ecpglib
Replace leftover instances of _() by ecpg_gettext(), the latter being the correct way to refer to the library's message catalog, instead of the one of the program using the library. Drop NLS support for ecpg_log(), which is a debugging instrument similar to elog() in the backend. We cannot support NLS in the ecpg compatlib, because that requires ecpg_gettext, which is in ecpglib, which is not a dependency of compatlib. It doesn't seem worthwhile to worry about this, since the only translatable string is "out of memory", and gettext probably won't be able to do much without memory either. Adjust messages to project style.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/connect.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 48d991d5068..d73199971e8 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.52 2008/12/17 16:52:07 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.53 2009/01/15 11:52:55 petere Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -223,7 +223,7 @@ ECPGnoticeReceiver(void *arg, const PGresult *result)
sqlstate = ECPG_SQLSTATE_ECPG_INTERNAL_ERROR;
if (message == NULL) /* Shouldn't happen, but need to be sure */
- message = _("No message received");
+ message = ecpg_gettext("empty message text");
/* these are not warnings */
if (strncmp(sqlstate, "00", 2) == 0)
@@ -378,7 +378,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
if (strncmp(dbname, "unix:", 5) != 0)
{
ecpg_log("ECPGconnect: socketname %s given for TCP connection on line %d\n", host, lineno);
- ecpg_raise(lineno, ECPG_CONNECT, ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION, realname ? realname : _("<DEFAULT>"));
+ ecpg_raise(lineno, ECPG_CONNECT, ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION, realname ? realname : ecpg_gettext("<DEFAULT>"));
if (host)
ecpg_free(host);
@@ -404,7 +404,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
if (strcmp(dbname + offset, "localhost") != 0 && strcmp(dbname + offset, "127.0.0.1") != 0)
{
ecpg_log("ECPGconnect: non-localhost access via sockets on line %d\n", lineno);
- ecpg_raise(lineno, ECPG_CONNECT, ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION, realname ? realname : _("<DEFAULT>"));
+ ecpg_raise(lineno, ECPG_CONNECT, ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION, realname ? realname : ecpg_gettext("<DEFAULT>"));
if (host)
ecpg_free(host);
if (port)
@@ -471,11 +471,11 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
actual_connection = all_connections;
ecpg_log("ECPGconnect: opening database %s on %s port %s %s%s %s%s\n",
- realname ? realname : _("<DEFAULT>"),
- host ? host : _("<DEFAULT>"),
- port ? (ecpg_internal_regression_mode ? _("<REGRESSION_PORT>") : port) : _("<DEFAULT>"),
- options ? _("with options ") : "", options ? options : "",
- user ? _("for user ") : "", user ? user : "");
+ realname ? realname : "<DEFAULT>",
+ host ? host : "<DEFAULT>",
+ port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
+ options ? "with options " : "", options ? options : "",
+ user ? "for user " : "", user ? user : "");
connect_string = ecpg_alloc( strlen_or_null(host)
+ strlen_or_null(port)
@@ -515,7 +515,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
if (PQstatus(this->connection) == CONNECTION_BAD)
{
const char *errmsg = PQerrorMessage(this->connection);
- const char *db = realname ? realname : _("<DEFAULT>");
+ const char *db = realname ? realname : ecpg_gettext("<DEFAULT>");
ecpg_log("ECPGconnect: could not open database: %s\n", errmsg);