Cleanup for gettext() calls - Mailing list pgsql-patches
From | Bruce Momjian |
---|---|
Subject | Cleanup for gettext() calls |
Date | |
Msg-id | 200502142304.j1EN42117274@candle.pha.pa.us Whole thread Raw |
Responses |
Re: Cleanup for gettext() calls
|
List | pgsql-patches |
Our current use of gettext() calls is inconsistent. We use: #define _(x) gettext((x)) in various C files to abreviate the use of gettext() around all string. This patch makes that consistent by moving the define to include/c.h. It also adds some missing gettext usage, particularly in src/port and interfaces/ecpg. I found that perl also defines _(x) so I undefined this in plperl. I don't see c.h is externally used so it seems safe to just use it consistently in our code. The attached patch makes these adjustments. Also, what is gettext_noop(x) used for? It seems it is just used to mark strings that should not be translated, but why are certain strings not to be translated? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 Index: src/backend/catalog/dependency.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/catalog/dependency.c,v retrieving revision 1.41 diff -c -c -r1.41 dependency.c *** src/backend/catalog/dependency.c 31 Dec 2004 21:59:38 -0000 1.41 --- src/backend/catalog/dependency.c 14 Feb 2005 20:04:37 -0000 *************** *** 1424,1441 **** case OCLASS_CLASS: getRelationDescription(&buffer, object->objectId); if (object->objectSubId != 0) ! appendStringInfo(&buffer, gettext(" column %s"), get_relid_attribute_name(object->objectId, object->objectSubId)); break; case OCLASS_PROC: ! appendStringInfo(&buffer, gettext("function %s"), format_procedure(object->objectId)); break; case OCLASS_TYPE: ! appendStringInfo(&buffer, gettext("type %s"), format_type_be(object->objectId)); break; --- 1424,1441 ---- case OCLASS_CLASS: getRelationDescription(&buffer, object->objectId); if (object->objectSubId != 0) ! appendStringInfo(&buffer, _(" column %s"), get_relid_attribute_name(object->objectId, object->objectSubId)); break; case OCLASS_PROC: ! appendStringInfo(&buffer, _("function %s"), format_procedure(object->objectId)); break; case OCLASS_TYPE: ! appendStringInfo(&buffer, _("type %s"), format_type_be(object->objectId)); break; *************** *** 1465,1471 **** castForm = (Form_pg_cast) GETSTRUCT(tup); ! appendStringInfo(&buffer, gettext("cast from %s to %s"), format_type_be(castForm->castsource), format_type_be(castForm->casttarget)); --- 1465,1471 ---- castForm = (Form_pg_cast) GETSTRUCT(tup); ! appendStringInfo(&buffer, _("cast from %s to %s"), format_type_be(castForm->castsource), format_type_be(castForm->casttarget)); *************** *** 1502,1514 **** if (OidIsValid(con->conrelid)) { ! appendStringInfo(&buffer, gettext("constraint %s on "), NameStr(con->conname)); getRelationDescription(&buffer, con->conrelid); } else { ! appendStringInfo(&buffer, gettext("constraint %s"), NameStr(con->conname)); } --- 1502,1514 ---- if (OidIsValid(con->conrelid)) { ! appendStringInfo(&buffer, _("constraint %s on "), NameStr(con->conname)); getRelationDescription(&buffer, con->conrelid); } else { ! appendStringInfo(&buffer, _("constraint %s"), NameStr(con->conname)); } *************** *** 1527,1533 **** if (!HeapTupleIsValid(conTup)) elog(ERROR, "cache lookup failed for conversion %u", object->objectId); ! appendStringInfo(&buffer, gettext("conversion %s"), NameStr(((Form_pg_conversion) GETSTRUCT(conTup))->conname)); ReleaseSysCache(conTup); break; --- 1527,1533 ---- if (!HeapTupleIsValid(conTup)) elog(ERROR, "cache lookup failed for conversion %u", object->objectId); ! appendStringInfo(&buffer, _("conversion %s"), NameStr(((Form_pg_conversion) GETSTRUCT(conTup))->conname)); ReleaseSysCache(conTup); break; *************** *** 1564,1570 **** colobject.objectId = attrdef->adrelid; colobject.objectSubId = attrdef->adnum; ! appendStringInfo(&buffer, gettext("default for %s"), getObjectDescription(&colobject)); systable_endscan(adscan); --- 1564,1570 ---- colobject.objectId = attrdef->adrelid; colobject.objectSubId = attrdef->adnum; ! appendStringInfo(&buffer, _("default for %s"), getObjectDescription(&colobject)); systable_endscan(adscan); *************** *** 1582,1595 **** if (!HeapTupleIsValid(langTup)) elog(ERROR, "cache lookup failed for language %u", object->objectId); ! appendStringInfo(&buffer, gettext("language %s"), NameStr(((Form_pg_language) GETSTRUCT(langTup))->lanname)); ReleaseSysCache(langTup); break; } case OCLASS_OPERATOR: ! appendStringInfo(&buffer, gettext("operator %s"), format_operator(object->objectId)); break; --- 1582,1595 ---- if (!HeapTupleIsValid(langTup)) elog(ERROR, "cache lookup failed for language %u", object->objectId); ! appendStringInfo(&buffer, _("language %s"), NameStr(((Form_pg_language) GETSTRUCT(langTup))->lanname)); ReleaseSysCache(langTup); break; } case OCLASS_OPERATOR: ! appendStringInfo(&buffer, _("operator %s"), format_operator(object->objectId)); break; *************** *** 1623,1629 **** else nspname = get_namespace_name(opcForm->opcnamespace); ! appendStringInfo(&buffer, gettext("operator class %s for access method %s"), quote_qualified_identifier(nspname, NameStr(opcForm->opcname)), NameStr(amForm->amname)); --- 1623,1629 ---- else nspname = get_namespace_name(opcForm->opcnamespace); ! appendStringInfo(&buffer, _("operator class %s for access method %s"), quote_qualified_identifier(nspname, NameStr(opcForm->opcname)), NameStr(amForm->amname)); *************** *** 1659,1665 **** rule = (Form_pg_rewrite) GETSTRUCT(tup); ! appendStringInfo(&buffer, gettext("rule %s on "), NameStr(rule->rulename)); getRelationDescription(&buffer, rule->ev_class); --- 1659,1665 ---- rule = (Form_pg_rewrite) GETSTRUCT(tup); ! appendStringInfo(&buffer, _("rule %s on "), NameStr(rule->rulename)); getRelationDescription(&buffer, rule->ev_class); *************** *** 1694,1700 **** trig = (Form_pg_trigger) GETSTRUCT(tup); ! appendStringInfo(&buffer, gettext("trigger %s on "), NameStr(trig->tgname)); getRelationDescription(&buffer, trig->tgrelid); --- 1694,1700 ---- trig = (Form_pg_trigger) GETSTRUCT(tup); ! appendStringInfo(&buffer, _("trigger %s on "), NameStr(trig->tgname)); getRelationDescription(&buffer, trig->tgrelid); *************** *** 1711,1717 **** if (!nspname) elog(ERROR, "cache lookup failed for namespace %u", object->objectId); ! appendStringInfo(&buffer, gettext("schema %s"), nspname); break; } --- 1711,1717 ---- if (!nspname) elog(ERROR, "cache lookup failed for namespace %u", object->objectId); ! appendStringInfo(&buffer, _("schema %s"), nspname); break; } *************** *** 1755,1794 **** switch (relForm->relkind) { case RELKIND_RELATION: ! appendStringInfo(buffer, gettext("table %s"), relname); break; case RELKIND_INDEX: ! appendStringInfo(buffer, gettext("index %s"), relname); break; case RELKIND_SPECIAL: ! appendStringInfo(buffer, gettext("special system relation %s"), relname); break; case RELKIND_SEQUENCE: ! appendStringInfo(buffer, gettext("sequence %s"), relname); break; case RELKIND_UNCATALOGED: ! appendStringInfo(buffer, gettext("uncataloged table %s"), relname); break; case RELKIND_TOASTVALUE: ! appendStringInfo(buffer, gettext("toast table %s"), relname); break; case RELKIND_VIEW: ! appendStringInfo(buffer, gettext("view %s"), relname); break; case RELKIND_COMPOSITE_TYPE: ! appendStringInfo(buffer, gettext("composite type %s"), relname); break; default: /* shouldn't get here */ ! appendStringInfo(buffer, gettext("relation %s"), relname); break; } --- 1755,1794 ---- switch (relForm->relkind) { case RELKIND_RELATION: ! appendStringInfo(buffer, _("table %s"), relname); break; case RELKIND_INDEX: ! appendStringInfo(buffer, _("index %s"), relname); break; case RELKIND_SPECIAL: ! appendStringInfo(buffer, _("special system relation %s"), relname); break; case RELKIND_SEQUENCE: ! appendStringInfo(buffer, _("sequence %s"), relname); break; case RELKIND_UNCATALOGED: ! appendStringInfo(buffer, _("uncataloged table %s"), relname); break; case RELKIND_TOASTVALUE: ! appendStringInfo(buffer, _("toast table %s"), relname); break; case RELKIND_VIEW: ! appendStringInfo(buffer, _("view %s"), relname); break; case RELKIND_COMPOSITE_TYPE: ! appendStringInfo(buffer, _("composite type %s"), relname); break; default: /* shouldn't get here */ ! appendStringInfo(buffer, _("relation %s"), relname); break; } Index: src/backend/libpq/auth.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/libpq/auth.c,v retrieving revision 1.122 diff -c -c -r1.122 auth.c *** src/backend/libpq/auth.c 12 Jan 2005 21:37:53 -0000 1.122 --- src/backend/libpq/auth.c 14 Feb 2005 20:04:37 -0000 *************** *** 449,455 **** (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), errmsg("no pg_hba.conf entry for host \"%s\", user \"%s\", database \"%s\", %s", hostinfo, port->user_name, port->database_name, ! port->ssl ? gettext("SSL on") : gettext("SSL off")))); #else ereport(FATAL, (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), --- 449,455 ---- (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), errmsg("no pg_hba.conf entry for host \"%s\", user \"%s\", database \"%s\", %s", hostinfo, port->user_name, port->database_name, ! port->ssl ? _("SSL on") : _("SSL off")))); #else ereport(FATAL, (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), Index: src/backend/libpq/pqcomm.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v retrieving revision 1.175 diff -c -c -r1.175 pqcomm.c *** src/backend/libpq/pqcomm.c 12 Jan 2005 16:38:17 -0000 1.175 --- src/backend/libpq/pqcomm.c 14 Feb 2005 20:04:38 -0000 *************** *** 308,328 **** switch (addr->ai_family) { case AF_INET: ! familyDesc = gettext("IPv4"); break; #ifdef HAVE_IPV6 case AF_INET6: ! familyDesc = gettext("IPv6"); break; #endif #ifdef HAVE_UNIX_SOCKETS case AF_UNIX: ! familyDesc = gettext("Unix"); break; #endif default: snprintf(familyDescBuf, sizeof(familyDescBuf), ! gettext("unrecognized address family %d"), addr->ai_family); familyDesc = familyDescBuf; break; --- 308,328 ---- switch (addr->ai_family) { case AF_INET: ! familyDesc = _("IPv4"); break; #ifdef HAVE_IPV6 case AF_INET6: ! familyDesc = _("IPv6"); break; #endif #ifdef HAVE_UNIX_SOCKETS case AF_UNIX: ! familyDesc = _("Unix"); break; #endif default: snprintf(familyDescBuf, sizeof(familyDescBuf), ! _("unrecognized address family %d"), addr->ai_family); familyDesc = familyDescBuf; break; Index: src/backend/parser/scan.l =================================================================== RCS file: /cvsroot/pgsql/src/backend/parser/scan.l,v retrieving revision 1.119 diff -c -c -r1.119 scan.l *** src/backend/parser/scan.l 31 Dec 2004 22:00:27 -0000 1.119 --- src/backend/parser/scan.l 14 Feb 2005 20:04:39 -0000 *************** *** 618,624 **** ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: %s is typically "syntax error" */ ! errmsg("%s at end of input", gettext(message)), errposition(cursorpos))); } else --- 618,624 ---- ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: %s is typically "syntax error" */ ! errmsg("%s at end of input", _(message)), errposition(cursorpos))); } else *************** *** 626,632 **** ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: first %s is typically "syntax error" */ ! errmsg("%s at or near \"%s\"", gettext(message), loc), errposition(cursorpos))); } } --- 626,632 ---- ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), /* translator: first %s is typically "syntax error" */ ! errmsg("%s at or near \"%s\"", _(message), loc), errposition(cursorpos))); } } Index: src/backend/postmaster/postmaster.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v retrieving revision 1.443 diff -c -c -r1.443 postmaster.c *** src/backend/postmaster/postmaster.c 12 Jan 2005 16:38:17 -0000 1.443 --- src/backend/postmaster/postmaster.c 14 Feb 2005 20:04:42 -0000 *************** *** 1067,1101 **** static void usage(const char *progname) { ! printf(gettext("%s is the PostgreSQL server.\n\n"), progname); ! printf(gettext("Usage:\n %s [OPTION]...\n\n"), progname); ! printf(gettext("Options:\n")); #ifdef USE_ASSERT_CHECKING ! printf(gettext(" -A 1|0 enable/disable run-time assert checking\n")); #endif ! printf(gettext(" -B NBUFFERS number of shared buffers\n")); ! printf(gettext(" -c NAME=VALUE set run-time parameter\n")); ! printf(gettext(" -d 1-5 debugging level\n")); ! printf(gettext(" -D DATADIR database directory\n")); ! printf(gettext(" -F turn fsync off\n")); ! printf(gettext(" -h HOSTNAME host name or IP address to listen on\n")); ! printf(gettext(" -i enable TCP/IP connections\n")); ! printf(gettext(" -k DIRECTORY Unix-domain socket location\n")); #ifdef USE_SSL ! printf(gettext(" -l enable SSL connections\n")); #endif ! printf(gettext(" -N MAX-CONNECT maximum number of allowed connections\n")); ! printf(gettext(" -o OPTIONS pass \"OPTIONS\" to each server process\n")); ! printf(gettext(" -p PORT port number to listen on\n")); ! printf(gettext(" -S silent mode (start in background without logging output)\n")); ! printf(gettext(" --help show this help, then exit\n")); ! printf(gettext(" --version output version information, then exit\n")); ! ! printf(gettext("\nDeveloper options:\n")); ! printf(gettext(" -n do not reinitialize shared memory after abnormal exit\n")); ! printf(gettext(" -s send SIGSTOP to all backend servers if one dies\n")); ! printf(gettext("\nPlease read the documentation for the complete list of run-time\n" "configuration settings and how to set them on the command line or in\n" "the configuration file.\n\n" "Report bugs to <pgsql-bugs@postgresql.org>.\n")); --- 1067,1101 ---- static void usage(const char *progname) { ! printf(_("%s is the PostgreSQL server.\n\n"), progname); ! printf(_("Usage:\n %s [OPTION]...\n\n"), progname); ! printf(_("Options:\n")); #ifdef USE_ASSERT_CHECKING ! printf(_(" -A 1|0 enable/disable run-time assert checking\n")); #endif ! printf(_(" -B NBUFFERS number of shared buffers\n")); ! printf(_(" -c NAME=VALUE set run-time parameter\n")); ! printf(_(" -d 1-5 debugging level\n")); ! printf(_(" -D DATADIR database directory\n")); ! printf(_(" -F turn fsync off\n")); ! printf(_(" -h HOSTNAME host name or IP address to listen on\n")); ! printf(_(" -i enable TCP/IP connections\n")); ! printf(_(" -k DIRECTORY Unix-domain socket location\n")); #ifdef USE_SSL ! printf(_(" -l enable SSL connections\n")); #endif ! printf(_(" -N MAX-CONNECT maximum number of allowed connections\n")); ! printf(_(" -o OPTIONS pass \"OPTIONS\" to each server process\n")); ! printf(_(" -p PORT port number to listen on\n")); ! printf(_(" -S silent mode (start in background without logging output)\n")); ! printf(_(" --help show this help, then exit\n")); ! printf(_(" --version output version information, then exit\n")); ! ! printf(_("\nDeveloper options:\n")); ! printf(_(" -n do not reinitialize shared memory after abnormal exit\n")); ! printf(_(" -s send SIGSTOP to all backend servers if one dies\n")); ! printf(_("\nPlease read the documentation for the complete list of run-time\n" "configuration settings and how to set them on the command line or in\n" "the configuration file.\n\n" "Report bugs to <pgsql-bugs@postgresql.org>.\n")); *************** *** 1993,1999 **** StartupPID = 0; if (exitstatus != 0) { ! LogChildExit(LOG, gettext("startup process"), pid, exitstatus); ereport(LOG, (errmsg("aborting startup due to startup process failure"))); --- 1993,1999 ---- StartupPID = 0; if (exitstatus != 0) { ! LogChildExit(LOG, _("startup process"), pid, exitstatus); ereport(LOG, (errmsg("aborting startup due to startup process failure"))); *************** *** 2059,2065 **** * Any unexpected exit of the bgwriter is treated as a crash. */ HandleChildCrash(pid, exitstatus, ! gettext("background writer process")); continue; } --- 2059,2065 ---- * Any unexpected exit of the bgwriter is treated as a crash. */ HandleChildCrash(pid, exitstatus, ! _("background writer process")); continue; } *************** *** 2072,2078 **** { PgArchPID = 0; if (exitstatus != 0) ! LogChildExit(LOG, gettext("archiver process"), pid, exitstatus); if (XLogArchivingActive() && StartupPID == 0 && !FatalError && Shutdown == NoShutdown) --- 2072,2078 ---- { PgArchPID = 0; if (exitstatus != 0) ! LogChildExit(LOG, _("archiver process"), pid, exitstatus); if (XLogArchivingActive() && StartupPID == 0 && !FatalError && Shutdown == NoShutdown) *************** *** 2089,2095 **** { PgStatPID = 0; if (exitstatus != 0) ! LogChildExit(LOG, gettext("statistics collector process"), pid, exitstatus); if (StartupPID == 0 && !FatalError && Shutdown == NoShutdown) PgStatPID = pgstat_start(); --- 2089,2095 ---- { PgStatPID = 0; if (exitstatus != 0) ! LogChildExit(LOG, _("statistics collector process"), pid, exitstatus); if (StartupPID == 0 && !FatalError && Shutdown == NoShutdown) PgStatPID = pgstat_start(); *************** *** 2103,2109 **** /* for safety's sake, launch new logger *first* */ SysLoggerPID = SysLogger_Start(); if (exitstatus != 0) ! LogChildExit(LOG, gettext("system logger process"), pid, exitstatus); continue; } --- 2103,2109 ---- /* for safety's sake, launch new logger *first* */ SysLoggerPID = SysLogger_Start(); if (exitstatus != 0) ! LogChildExit(LOG, _("system logger process"), pid, exitstatus); continue; } *************** *** 2170,2176 **** { Dlelem *curr; ! LogChildExit(DEBUG2, gettext("server process"), pid, exitstatus); /* * If a backend dies in an ugly way (i.e. exit status not 0) then we --- 2170,2176 ---- { Dlelem *curr; ! LogChildExit(DEBUG2, _("server process"), pid, exitstatus); /* * If a backend dies in an ugly way (i.e. exit status not 0) then we *************** *** 2180,2186 **** */ if (exitstatus != 0) { ! HandleChildCrash(pid, exitstatus, gettext("server process")); return; } --- 2180,2186 ---- */ if (exitstatus != 0) { ! HandleChildCrash(pid, exitstatus, _("server process")); return; } *************** *** 2504,2510 **** /* Format the error message packet (always V2 protocol) */ snprintf(buffer, sizeof(buffer), "E%s%s\n", ! gettext("could not fork new process for connection: "), strerror(errnum)); /* Set port to non-blocking. Don't do send() if this fails */ --- 2504,2510 ---- /* Format the error message packet (always V2 protocol) */ snprintf(buffer, sizeof(buffer), "E%s%s\n", ! _("could not fork new process for connection: "), strerror(errnum)); /* Set port to non-blocking. Don't do send() if this fails */ Index: src/backend/storage/lmgr/deadlock.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/storage/lmgr/deadlock.c,v retrieving revision 1.32 diff -c -c -r1.32 deadlock.c *** src/backend/storage/lmgr/deadlock.c 31 Dec 2004 22:01:05 -0000 1.32 --- src/backend/storage/lmgr/deadlock.c 14 Feb 2005 20:04:44 -0000 *************** *** 864,870 **** { /* Lock is for transaction ID */ appendStringInfo(&buf, ! gettext("Process %d waits for %s on transaction %u; blocked by process %d."), info->pid, GetLockmodeName(info->lockmode), info->locktag.objId.xid, --- 864,870 ---- { /* Lock is for transaction ID */ appendStringInfo(&buf, ! _("Process %d waits for %s on transaction %u; blocked by process %d."), info->pid, GetLockmodeName(info->lockmode), info->locktag.objId.xid, *************** *** 874,880 **** { /* Lock is for a relation */ appendStringInfo(&buf, ! gettext("Process %d waits for %s on relation %u of database %u; blocked by process %d."), info->pid, GetLockmodeName(info->lockmode), info->locktag.relId, --- 874,880 ---- { /* Lock is for a relation */ appendStringInfo(&buf, ! _("Process %d waits for %s on relation %u of database %u; blocked by process %d."), info->pid, GetLockmodeName(info->lockmode), info->locktag.relId, Index: src/backend/tcop/postgres.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/tcop/postgres.c,v retrieving revision 1.440 diff -c -c -r1.440 postgres.c *** src/backend/tcop/postgres.c 31 Dec 2004 22:01:16 -0000 1.440 --- src/backend/tcop/postgres.c 14 Feb 2005 20:04:47 -0000 *************** *** 2119,2153 **** static void usage(const char *progname) { ! printf(gettext("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n"), progname); ! printf(gettext("Usage:\n %s [OPTION]... [DBNAME]\n\n"), progname); ! printf(gettext("Options:\n")); #ifdef USE_ASSERT_CHECKING ! printf(gettext(" -A 1|0 enable/disable run-time assert checking\n")); #endif ! printf(gettext(" -B NBUFFERS number of shared buffers\n")); ! printf(gettext(" -c NAME=VALUE set run-time parameter\n")); ! printf(gettext(" -d 0-5 debugging level (0 is off)\n")); ! printf(gettext(" -D DATADIR database directory\n")); ! printf(gettext(" -e use European date input format (DMY)\n")); ! printf(gettext(" -E echo query before execution\n")); ! printf(gettext(" -F turn fsync off\n")); ! printf(gettext(" -N do not use newline as interactive query delimiter\n")); ! printf(gettext(" -o FILENAME send stdout and stderr to given file\n")); ! printf(gettext(" -P disable system indexes\n")); ! printf(gettext(" -s show statistics after each query\n")); ! printf(gettext(" -S WORK-MEM set amount of memory for sorts (in kB)\n")); ! printf(gettext(" --describe-config describe configuration parameters, then exit\n")); ! printf(gettext(" --help show this help, then exit\n")); ! printf(gettext(" --version output version information, then exit\n")); ! printf(gettext("\nDeveloper options:\n")); ! printf(gettext(" -f s|i|n|m|h forbid use of some plan types\n")); ! printf(gettext(" -i do not execute queries\n")); ! printf(gettext(" -O allow system table structure changes\n")); ! printf(gettext(" -t pa|pl|ex show timings after each query\n")); ! printf(gettext(" -W NUM wait NUM seconds to allow attach from a debugger\n")); ! printf(gettext("\nReport bugs to <pgsql-bugs@postgresql.org>.\n")); } --- 2119,2153 ---- static void usage(const char *progname) { ! printf(_("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n"), progname); ! printf(_("Usage:\n %s [OPTION]... [DBNAME]\n\n"), progname); ! printf(_("Options:\n")); #ifdef USE_ASSERT_CHECKING ! printf(_(" -A 1|0 enable/disable run-time assert checking\n")); #endif ! printf(_(" -B NBUFFERS number of shared buffers\n")); ! printf(_(" -c NAME=VALUE set run-time parameter\n")); ! printf(_(" -d 0-5 debugging level (0 is off)\n")); ! printf(_(" -D DATADIR database directory\n")); ! printf(_(" -e use European date input format (DMY)\n")); ! printf(_(" -E echo query before execution\n")); ! printf(_(" -F turn fsync off\n")); ! printf(_(" -N do not use newline as interactive query delimiter\n")); ! printf(_(" -o FILENAME send stdout and stderr to given file\n")); ! printf(_(" -P disable system indexes\n")); ! printf(_(" -s show statistics after each query\n")); ! printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n")); ! printf(_(" --describe-config describe configuration parameters, then exit\n")); ! printf(_(" --help show this help, then exit\n")); ! printf(_(" --version output version information, then exit\n")); ! printf(_("\nDeveloper options:\n")); ! printf(_(" -f s|i|n|m|h forbid use of some plan types\n")); ! printf(_(" -i do not execute queries\n")); ! printf(_(" -O allow system table structure changes\n")); ! printf(_(" -t pa|pl|ex show timings after each query\n")); ! printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n")); ! printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n")); } Index: src/backend/utils/error/elog.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/error/elog.c,v retrieving revision 1.155 diff -c -c -r1.155 elog.c *** src/backend/utils/error/elog.c 31 Dec 2004 22:01:27 -0000 1.155 --- src/backend/utils/error/elog.c 14 Feb 2005 20:04:48 -0000 *************** *** 598,604 **** char *fmtbuf; \ StringInfoData buf; \ /* Internationalize the error format string */ \ ! fmt = gettext(fmt); \ /* Expand %m in format string */ \ fmtbuf = expand_fmt_string(fmt, edata); \ initStringInfo(&buf); \ --- 598,604 ---- char *fmtbuf; \ StringInfoData buf; \ /* Internationalize the error format string */ \ ! fmt = _(fmt); \ /* Expand %m in format string */ \ fmtbuf = expand_fmt_string(fmt, edata); \ initStringInfo(&buf); \ *************** *** 1347,1353 **** const char *username = MyProcPort->user_name; if (username == NULL || *username == '\0') ! username = gettext("[unknown]"); appendStringInfo(buf, "%s", username); } break; --- 1347,1353 ---- const char *username = MyProcPort->user_name; if (username == NULL || *username == '\0') ! username = _("[unknown]"); appendStringInfo(buf, "%s", username); } break; *************** *** 1357,1363 **** const char *dbname = MyProcPort->database_name; if (dbname == NULL || *dbname == '\0') ! dbname = gettext("[unknown]"); appendStringInfo(buf, "%s", dbname); } break; --- 1357,1363 ---- const char *dbname = MyProcPort->database_name; if (dbname == NULL || *dbname == '\0') ! dbname = _("[unknown]"); appendStringInfo(buf, "%s", dbname); } break; *************** *** 1485,1497 **** if (edata->message) append_with_tabs(&buf, edata->message); else ! append_with_tabs(&buf, gettext("missing error text")); if (edata->cursorpos > 0) ! appendStringInfo(&buf, gettext(" at character %d"), edata->cursorpos); else if (edata->internalpos > 0) ! appendStringInfo(&buf, gettext(" at character %d"), edata->internalpos); appendStringInfoChar(&buf, '\n'); --- 1485,1497 ---- if (edata->message) append_with_tabs(&buf, edata->message); else ! append_with_tabs(&buf, _("missing error text")); if (edata->cursorpos > 0) ! appendStringInfo(&buf, _(" at character %d"), edata->cursorpos); else if (edata->internalpos > 0) ! appendStringInfo(&buf, _(" at character %d"), edata->internalpos); appendStringInfoChar(&buf, '\n'); *************** *** 1501,1528 **** if (edata->detail) { log_line_prefix(&buf); ! appendStringInfoString(&buf, gettext("DETAIL: ")); append_with_tabs(&buf, edata->detail); appendStringInfoChar(&buf, '\n'); } if (edata->hint) { log_line_prefix(&buf); ! appendStringInfoString(&buf, gettext("HINT: ")); append_with_tabs(&buf, edata->hint); appendStringInfoChar(&buf, '\n'); } if (edata->internalquery) { log_line_prefix(&buf); ! appendStringInfoString(&buf, gettext("QUERY: ")); append_with_tabs(&buf, edata->internalquery); appendStringInfoChar(&buf, '\n'); } if (edata->context) { log_line_prefix(&buf); ! appendStringInfoString(&buf, gettext("CONTEXT: ")); append_with_tabs(&buf, edata->context); appendStringInfoChar(&buf, '\n'); } --- 1501,1528 ---- if (edata->detail) { log_line_prefix(&buf); ! appendStringInfoString(&buf, _("DETAIL: ")); append_with_tabs(&buf, edata->detail); appendStringInfoChar(&buf, '\n'); } if (edata->hint) { log_line_prefix(&buf); ! appendStringInfoString(&buf, _("HINT: ")); append_with_tabs(&buf, edata->hint); appendStringInfoChar(&buf, '\n'); } if (edata->internalquery) { log_line_prefix(&buf); ! appendStringInfoString(&buf, _("QUERY: ")); append_with_tabs(&buf, edata->internalquery); appendStringInfoChar(&buf, '\n'); } if (edata->context) { log_line_prefix(&buf); ! appendStringInfoString(&buf, _("CONTEXT: ")); append_with_tabs(&buf, edata->context); appendStringInfoChar(&buf, '\n'); } *************** *** 1532,1545 **** if (edata->funcname && edata->filename) { log_line_prefix(&buf); ! appendStringInfo(&buf, gettext("LOCATION: %s, %s:%d\n"), edata->funcname, edata->filename, edata->lineno); } else if (edata->filename) { log_line_prefix(&buf); ! appendStringInfo(&buf, gettext("LOCATION: %s:%d\n"), edata->filename, edata->lineno); } } --- 1532,1545 ---- if (edata->funcname && edata->filename) { log_line_prefix(&buf); ! appendStringInfo(&buf, _("LOCATION: %s, %s:%d\n"), edata->funcname, edata->filename, edata->lineno); } else if (edata->filename) { log_line_prefix(&buf); ! appendStringInfo(&buf, _("LOCATION: %s:%d\n"), edata->filename, edata->lineno); } } *************** *** 1552,1558 **** if (edata->elevel >= log_min_error_statement && debug_query_string != NULL) { log_line_prefix(&buf); ! appendStringInfoString(&buf, gettext("STATEMENT: ")); append_with_tabs(&buf, debug_query_string); appendStringInfoChar(&buf, '\n'); } --- 1552,1558 ---- if (edata->elevel >= log_min_error_statement && debug_query_string != NULL) { log_line_prefix(&buf); ! appendStringInfoString(&buf, _("STATEMENT: ")); append_with_tabs(&buf, debug_query_string); appendStringInfoChar(&buf, '\n'); } *************** *** 1678,1684 **** if (edata->message) pq_sendstring(&msgbuf, edata->message); else ! pq_sendstring(&msgbuf, gettext("missing error text")); if (edata->detail) { --- 1678,1684 ---- if (edata->message) pq_sendstring(&msgbuf, edata->message); else ! pq_sendstring(&msgbuf, _("missing error text")); if (edata->detail) { *************** *** 1754,1766 **** if (edata->message) appendStringInfoString(&buf, edata->message); else ! appendStringInfoString(&buf, gettext("missing error text")); if (edata->cursorpos > 0) ! appendStringInfo(&buf, gettext(" at character %d"), edata->cursorpos); else if (edata->internalpos > 0) ! appendStringInfo(&buf, gettext(" at character %d"), edata->internalpos); appendStringInfoChar(&buf, '\n'); --- 1754,1766 ---- if (edata->message) appendStringInfoString(&buf, edata->message); else ! appendStringInfoString(&buf, _("missing error text")); if (edata->cursorpos > 0) ! appendStringInfo(&buf, _(" at character %d"), edata->cursorpos); else if (edata->internalpos > 0) ! appendStringInfo(&buf, _(" at character %d"), edata->internalpos); appendStringInfoChar(&buf, '\n'); *************** *** 1870,1876 **** * expanded. */ snprintf(errorstr_buf, sizeof(errorstr_buf), ! gettext("operating system error %d"), errnum); str = errorstr_buf; } --- 1870,1876 ---- * expanded. */ snprintf(errorstr_buf, sizeof(errorstr_buf), ! _("operating system error %d"), errnum); str = errorstr_buf; } *************** *** 1893,1921 **** case DEBUG3: case DEBUG4: case DEBUG5: ! prefix = gettext("DEBUG"); break; case LOG: case COMMERROR: ! prefix = gettext("LOG"); break; case INFO: ! prefix = gettext("INFO"); break; case NOTICE: ! prefix = gettext("NOTICE"); break; case WARNING: ! prefix = gettext("WARNING"); break; case ERROR: ! prefix = gettext("ERROR"); break; case FATAL: ! prefix = gettext("FATAL"); break; case PANIC: ! prefix = gettext("PANIC"); break; default: prefix = "???"; --- 1893,1921 ---- case DEBUG3: case DEBUG4: case DEBUG5: ! prefix = _("DEBUG"); break; case LOG: case COMMERROR: ! prefix = _("LOG"); break; case INFO: ! prefix = _("INFO"); break; case NOTICE: ! prefix = _("NOTICE"); break; case WARNING: ! prefix = _("WARNING"); break; case ERROR: ! prefix = _("ERROR"); break; case FATAL: ! prefix = _("FATAL"); break; case PANIC: ! prefix = _("PANIC"); break; default: prefix = "???"; *************** *** 1956,1962 **** { va_list ap; ! fmt = gettext(fmt); va_start(ap, fmt); #ifndef WIN32 --- 1956,1962 ---- { va_list ap; ! fmt = _(fmt); va_start(ap, fmt); #ifndef WIN32 Index: src/backend/utils/misc/help_config.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/misc/help_config.c,v retrieving revision 1.14 diff -c -c -r1.14 help_config.c *** src/backend/utils/misc/help_config.c 31 Dec 2004 22:02:45 -0000 1.14 --- src/backend/utils/misc/help_config.c 14 Feb 2005 20:04:49 -0000 *************** *** 91,97 **** printf("%s\t%s\t%s\t", structToPrint->generic.name, GucContext_Names[structToPrint->generic.context], ! gettext(config_group_names[structToPrint->generic.group])); switch (structToPrint->generic.vartype) { --- 91,97 ---- printf("%s\t%s\t%s\t", structToPrint->generic.name, GucContext_Names[structToPrint->generic.context], ! _(config_group_names[structToPrint->generic.group])); switch (structToPrint->generic.vartype) { *************** *** 127,132 **** } printf("%s\t%s\n", ! (structToPrint->generic.short_desc == NULL) ? "" : gettext(structToPrint->generic.short_desc), ! (structToPrint->generic.long_desc == NULL) ? "" : gettext(structToPrint->generic.long_desc)); } --- 127,132 ---- } printf("%s\t%s\n", ! (structToPrint->generic.short_desc == NULL) ? "" : _(structToPrint->generic.short_desc), ! (structToPrint->generic.long_desc == NULL) ? "" : _(structToPrint->generic.long_desc)); } Index: src/bin/initdb/initdb.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/initdb/initdb.c,v retrieving revision 1.74 diff -c -c -r1.74 initdb.c *** src/bin/initdb/initdb.c 28 Jan 2005 00:34:32 -0000 1.74 --- src/bin/initdb/initdb.c 14 Feb 2005 20:04:51 -0000 *************** *** 65,72 **** #endif - #define _(x) gettext((x)) - /* version string we expect back from postgres */ #define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" --- 65,70 ---- Index: src/bin/pg_config/pg_config.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_config/pg_config.c,v retrieving revision 1.10 diff -c -c -r1.10 pg_config.c *** src/bin/pg_config/pg_config.c 31 Dec 2004 22:03:03 -0000 1.10 --- src/bin/pg_config/pg_config.c 14 Feb 2005 20:04:51 -0000 *************** *** 26,33 **** #include "port.h" #include <stdio.h> - #define _(x) gettext((x)) - static const char *progname; static void --- 26,31 ---- Index: src/bin/pg_controldata/pg_controldata.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v retrieving revision 1.20 diff -c -c -r1.20 pg_controldata.c *** src/bin/pg_controldata/pg_controldata.c 23 Sep 2004 00:47:44 -0000 1.20 --- src/bin/pg_controldata/pg_controldata.c 14 Feb 2005 20:04:51 -0000 *************** *** 17,24 **** #include "catalog/pg_control.h" - #define _(x) gettext((x)) - static void usage(const char *progname) --- 17,22 ---- Index: src/bin/pg_ctl/pg_ctl.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_ctl/pg_ctl.c,v retrieving revision 1.53 diff -c -c -r1.53 pg_ctl.c *** src/bin/pg_ctl/pg_ctl.c 31 Dec 2004 22:03:05 -0000 1.53 --- src/bin/pg_ctl/pg_ctl.c 14 Feb 2005 20:04:52 -0000 *************** *** 35,41 **** /* PID can be negative for standalone backend */ typedef long pgpid_t; - #define _(x) gettext((x)) #define WHITESPACE "\f\n\r\t\v" /* as defined by isspace() */ --- 35,40 ---- Index: src/bin/pg_dump/pg_backup_archiver.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v retrieving revision 1.104 diff -c -c -r1.104 pg_backup_archiver.c *** src/bin/pg_dump/pg_backup_archiver.c 26 Jan 2005 19:44:43 -0000 1.104 --- src/bin/pg_dump/pg_backup_archiver.c 14 Feb 2005 20:04:54 -0000 *************** *** 1187,1196 **** _write_msg(const char *modulename, const char *fmt, va_list ap) { if (modulename) ! fprintf(stderr, "%s: [%s] ", progname, gettext(modulename)); else fprintf(stderr, "%s: ", progname); ! vfprintf(stderr, gettext(fmt), ap); } void --- 1187,1196 ---- _write_msg(const char *modulename, const char *fmt, va_list ap) { if (modulename) ! fprintf(stderr, "%s: [%s] ", progname, _(modulename)); else fprintf(stderr, "%s: ", progname); ! vfprintf(stderr, _(fmt), ap); } void Index: src/bin/pg_dump/pg_dump.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v retrieving revision 1.402 diff -c -c -r1.402 pg_dump.c *** src/bin/pg_dump/pg_dump.c 26 Jan 2005 21:24:12 -0000 1.402 --- src/bin/pg_dump/pg_dump.c 14 Feb 2005 20:05:00 -0000 *************** *** 61,68 **** #include "pg_backup_archiver.h" #include "dumputils.h" - #define _(x) gettext((x)) - extern char *optarg; extern int optind, opterr; --- 61,66 ---- Index: src/bin/pg_dump/pg_dumpall.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v retrieving revision 1.57 diff -c -c -r1.57 pg_dumpall.c *** src/bin/pg_dump/pg_dumpall.c 31 Dec 2004 22:03:09 -0000 1.57 --- src/bin/pg_dump/pg_dumpall.c 14 Feb 2005 20:05:01 -0000 *************** *** 34,40 **** #include "pg_backup.h" #include "pqexpbuffer.h" - #define _(x) gettext((x)) /* version string we expect back from postgres */ #define PG_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n" --- 34,39 ---- Index: src/bin/pg_dump/pg_restore.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v retrieving revision 1.68 diff -c -c -r1.68 pg_restore.c *** src/bin/pg_dump/pg_restore.c 3 Dec 2004 18:48:19 -0000 1.68 --- src/bin/pg_dump/pg_restore.c 14 Feb 2005 20:05:01 -0000 *************** *** 65,71 **** #include <locale.h> #endif - #define _(x) gettext((x)) /* Forward decls */ static void usage(const char *progname); --- 65,70 ---- Index: src/bin/pg_resetxlog/pg_resetxlog.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v retrieving revision 1.28 diff -c -c -r1.28 pg_resetxlog.c *** src/bin/pg_resetxlog/pg_resetxlog.c 31 Dec 2004 22:03:11 -0000 1.28 --- src/bin/pg_resetxlog/pg_resetxlog.c 14 Feb 2005 20:05:02 -0000 *************** *** 48,55 **** extern int optind; extern char *optarg; - #define _(x) gettext((x)) - char XLogDir[MAXPGPATH]; /* not static, see xlog_internal.h */ static char ControlFilePath[MAXPGPATH]; --- 48,53 ---- Index: src/bin/psql/command.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/command.c,v retrieving revision 1.139 diff -c -c -r1.139 command.c *** src/bin/psql/command.c 1 Jan 2005 05:43:08 -0000 1.139 --- src/bin/psql/command.c 14 Feb 2005 20:05:03 -0000 *************** *** 121,127 **** if (status == CMD_UNKNOWN) { if (pset.cur_cmd_interactive) ! fprintf(stderr, gettext("Invalid command \\%s. Try \\? for help.\n"), cmd); else psql_error("invalid command \\%s\n", cmd); status = CMD_ERROR; --- 121,127 ---- if (status == CMD_UNKNOWN) { if (pset.cur_cmd_interactive) ! fprintf(stderr, _("Invalid command \\%s. Try \\? for help.\n"), cmd); else psql_error("invalid command \\%s\n", cmd); status = CMD_ERROR; *************** *** 609,615 **** if (query_buf && query_buf->len > 0) puts(query_buf->data); else if (!quiet) ! puts(gettext("Query buffer is empty.")); fflush(stdout); } --- 609,615 ---- if (query_buf && query_buf->len > 0) puts(query_buf->data); else if (!quiet) ! puts(_("Query buffer is empty.")); fflush(stdout); } *************** *** 643,649 **** resetPQExpBuffer(query_buf); psql_scan_reset(scan_state); if (!quiet) ! puts(gettext("Query buffer reset (cleared).")); } /* \s save history in a file or show it on the screen */ --- 643,649 ---- resetPQExpBuffer(query_buf); psql_scan_reset(scan_state); if (!quiet) ! puts(_("Query buffer reset (cleared).")); } /* \s save history in a file or show it on the screen */ *************** *** 657,663 **** success = saveHistory(fname ? fname : "/dev/tty"); if (success && !quiet && fname) ! printf(gettext("Wrote history to file \"%s\".\n"), fname); if (!fname) putchar('\n'); free(fname); --- 657,663 ---- success = saveHistory(fname ? fname : "/dev/tty"); if (success && !quiet && fname) ! printf(_("Wrote history to file \"%s\".\n"), fname); if (!fname) putchar('\n'); free(fname); *************** *** 739,747 **** if (!quiet) { if (pset.timing) ! puts(gettext("Timing is on.")); else ! puts(gettext("Timing is off.")); } } --- 739,747 ---- if (!quiet) { if (pset.timing) ! puts(_("Timing is on.")); else ! puts(_("Timing is off.")); } } *************** *** 970,976 **** PQfinish(pset.db); if (oldconn) { ! fputs(gettext("Previous connection kept\n"), stderr); pset.db = oldconn; } else --- 970,976 ---- PQfinish(pset.db); if (oldconn) { ! fputs(_("Previous connection kept\n"), stderr); pset.db = oldconn; } else *************** *** 994,1005 **** if (!QUIET()) { if (userparam != new_user) /* no new user */ ! printf(gettext("You are now connected to database \"%s\".\n"), dbparam); else if (dbparam != new_dbname) /* no new db */ ! printf(gettext("You are now connected as new user \"%s\".\n"), new_user); else /* both new */ ! printf(gettext("You are now connected to database \"%s\" as user \"%s\".\n"), PQdb(pset.db), PQuser(pset.db)); } --- 994,1005 ---- if (!QUIET()) { if (userparam != new_user) /* no new user */ ! printf(_("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); else /* both new */ ! printf(_("You are now connected to database \"%s\" as user \"%s\".\n"), PQdb(pset.db), PQuser(pset.db)); } *************** *** 1388,1394 **** } if (!quiet) ! printf(gettext("Output format is %s.\n"), _align2string(popt->topt.format)); } /* set border style/width */ --- 1388,1394 ---- } if (!quiet) ! printf(_("Output format is %s.\n"), _align2string(popt->topt.format)); } /* set border style/width */ *************** *** 1398,1404 **** popt->topt.border = atoi(value); if (!quiet) ! printf(gettext("Border style is %d.\n"), popt->topt.border); } /* set expanded/vertical mode */ --- 1398,1404 ---- popt->topt.border = atoi(value); if (!quiet) ! printf(_("Border style is %d.\n"), popt->topt.border); } /* set expanded/vertical mode */ *************** *** 1407,1414 **** popt->topt.expanded = !popt->topt.expanded; if (!quiet) printf(popt->topt.expanded ! ? gettext("Expanded display is on.\n") ! : gettext("Expanded display is off.\n")); } /* null display */ --- 1407,1414 ---- popt->topt.expanded = !popt->topt.expanded; if (!quiet) printf(popt->topt.expanded ! ? _("Expanded display is on.\n") ! : _("Expanded display is off.\n")); } /* null display */ *************** *** 1420,1426 **** popt->nullPrint = pg_strdup(value); } if (!quiet) ! printf(gettext("Null display is \"%s\".\n"), popt->nullPrint ? popt->nullPrint : ""); } /* field separator for unaligned text */ --- 1420,1426 ---- popt->nullPrint = pg_strdup(value); } if (!quiet) ! printf(_("Null display is \"%s\".\n"), popt->nullPrint ? popt->nullPrint : ""); } /* field separator for unaligned text */ *************** *** 1432,1438 **** popt->topt.fieldSep = pg_strdup(value); } if (!quiet) ! printf(gettext("Field separator is \"%s\".\n"), popt->topt.fieldSep); } /* record separator for unaligned text */ --- 1432,1438 ---- popt->topt.fieldSep = pg_strdup(value); } if (!quiet) ! printf(_("Field separator is \"%s\".\n"), popt->topt.fieldSep); } /* record separator for unaligned text */ *************** *** 1446,1454 **** if (!quiet) { if (strcmp(popt->topt.recordSep, "\n") == 0) ! printf(gettext("Record separator is <newline>.")); else ! printf(gettext("Record separator is \"%s\".\n"), popt->topt.recordSep); } } --- 1446,1454 ---- if (!quiet) { if (strcmp(popt->topt.recordSep, "\n") == 0) ! printf(_("Record separator is <newline>.")); else ! printf(_("Record separator is \"%s\".\n"), popt->topt.recordSep); } } *************** *** 1459,1467 **** if (!quiet) { if (popt->topt.tuples_only) ! puts(gettext("Showing only tuples.")); else ! puts(gettext("Tuples only is off.")); } } --- 1459,1467 ---- if (!quiet) { if (popt->topt.tuples_only) ! puts(_("Showing only tuples.")); else ! puts(_("Tuples only is off.")); } } *************** *** 1477,1485 **** if (!quiet) { if (popt->title) ! printf(gettext("Title is \"%s\".\n"), popt->title); else ! printf(gettext("Title is unset.\n")); } } --- 1477,1485 ---- if (!quiet) { if (popt->title) ! printf(_("Title is \"%s\".\n"), popt->title); else ! printf(_("Title is unset.\n")); } } *************** *** 1495,1503 **** if (!quiet) { if (popt->topt.tableAttr) ! printf(gettext("Table attribute is \"%s\".\n"), popt->topt.tableAttr); else ! printf(gettext("Table attributes unset.\n")); } } --- 1495,1503 ---- if (!quiet) { if (popt->topt.tableAttr) ! printf(_("Table attribute is \"%s\".\n"), popt->topt.tableAttr); else ! printf(_("Table attributes unset.\n")); } } *************** *** 1513,1523 **** if (!quiet) { if (popt->topt.pager == 1) ! puts(gettext("Pager is used for long output.")); else if (popt->topt.pager == 2) ! puts(gettext("Pager is always used.")); else ! puts(gettext("Pager usage is off.")); } } --- 1513,1523 ---- if (!quiet) { if (popt->topt.pager == 1) ! puts(_("Pager is used for long output.")); else if (popt->topt.pager == 2) ! puts(_("Pager is always used.")); else ! puts(_("Pager usage is off.")); } } *************** *** 1528,1536 **** if (!quiet) { if (popt->default_footer) ! puts(gettext("Default footer is on.")); else ! puts(gettext("Default footer is off.")); } } --- 1528,1536 ---- if (!quiet) { if (popt->default_footer) ! puts(_("Default footer is on.")); else ! puts(_("Default footer is off.")); } } Index: src/bin/psql/common.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/common.c,v retrieving revision 1.95 diff -c -c -r1.95 common.c *** src/bin/psql/common.c 1 Jan 2005 05:43:08 -0000 1.95 --- src/bin/psql/common.c 14 Feb 2005 20:05:04 -0000 *************** *** 75,81 **** if (!string) { ! fprintf(stderr, gettext("%s: xstrdup: cannot duplicate null pointer (internal error)\n"), pset.progname); exit(EXIT_FAILURE); } --- 75,81 ---- if (!string) { ! fprintf(stderr, _("%s: xstrdup: cannot duplicate null pointer (internal error)\n"), pset.progname); exit(EXIT_FAILURE); } *************** *** 200,206 **** if (pset.inputfile) fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno); va_start(ap, fmt); ! vfprintf(stderr, gettext(fmt), ap); va_end(ap); } --- 200,206 ---- if (pset.inputfile) fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno); va_start(ap, fmt); ! vfprintf(stderr, _(fmt), ap); va_end(ap); } *************** *** 357,375 **** exit(EXIT_BADCONN); } ! fputs(gettext("The connection to the server was lost. Attempting reset: "), stderr); PQreset(pset.db); OK = ConnectionUp(); if (!OK) { ! fputs(gettext("Failed.\n"), stderr); PQfinish(pset.db); pset.db = NULL; ResetCancelConn(); UnsyncVariables(); } else ! fputs(gettext("Succeeded.\n"), stderr); } return OK; --- 357,375 ---- exit(EXIT_BADCONN); } ! fputs(_("The connection to the server was lost. Attempting reset: "), stderr); PQreset(pset.db); OK = ConnectionUp(); if (!OK) { ! fputs(_("Failed.\n"), stderr); PQfinish(pset.db); pset.db = NULL; ResetCancelConn(); UnsyncVariables(); } else ! fputs(_("Succeeded.\n"), stderr); } return OK; *************** *** 604,610 **** wquery[qidx[iend]] = '\0'; /* Begin building the finished message. */ ! printfPQExpBuffer(&msg, gettext("LINE %d: "), loc_line); if (beg_trunc) appendPQExpBufferStr(&msg, "..."); --- 604,610 ---- wquery[qidx[iend]] = '\0'; /* Begin building the finished message. */ ! printfPQExpBuffer(&msg, _("LINE %d: "), loc_line); if (beg_trunc) appendPQExpBufferStr(&msg, "..."); *************** *** 768,774 **** while ((notify = PQnotifies(pset.db))) { ! fprintf(pset.queryFout, gettext("Asynchronous notification \"%s\" received from server process with PID %d.\n"), notify->relname, notify->be_pid); fflush(pset.queryFout); PQfreemem(notify); --- 768,774 ---- while ((notify = PQnotifies(pset.db))) { ! fprintf(pset.queryFout, _("Asynchronous notification \"%s\" received from server process with PID %d.\n"), notify->relname, notify->be_pid); fflush(pset.queryFout); PQfreemem(notify); *************** *** 956,962 **** { char buf[3]; ! printf(gettext("***(Single step mode: verify command)*******************************************\n" "%s\n" "***(press return to proceed or enter x and return to cancel)********************\n"), query); --- 956,962 ---- { char buf[3]; ! printf(_("***(Single step mode: verify command)*******************************************\n" "%s\n" "***(press return to proceed or enter x and return to cancel)********************\n"), query); *************** *** 1007,1013 **** /* Possible microtiming output */ if (OK && pset.timing) ! printf(gettext("Time: %.3f ms\n"), DIFF_MSEC(&after, &before)); /* check for events that may occur during query execution */ --- 1007,1013 ---- /* Possible microtiming output */ if (OK && pset.timing) ! printf(_("Time: %.3f ms\n"), DIFF_MSEC(&after, &before)); /* check for events that may occur during query execution */ Index: src/bin/psql/copy.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/copy.c,v retrieving revision 1.55 diff -c -c -r1.55 copy.c *** src/bin/psql/copy.c 1 Jan 2005 05:43:08 -0000 1.55 --- src/bin/psql/copy.c 14 Feb 2005 20:05:04 -0000 *************** *** 665,671 **** if (isatty(fileno(copystream))) { if (!QUIET()) ! puts(gettext("Enter data to be copied followed by a newline.\n" "End with a backslash and a period on a line by itself.")); prompt = get_prompt(PROMPT_COPY); } --- 665,671 ---- if (isatty(fileno(copystream))) { if (!QUIET()) ! puts(_("Enter data to be copied followed by a newline.\n" "End with a backslash and a period on a line by itself.")); prompt = get_prompt(PROMPT_COPY); } Index: src/bin/psql/describe.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/describe.c,v retrieving revision 1.111 diff -c -c -r1.111 describe.c *** src/bin/psql/describe.c 1 Jan 2005 05:43:08 -0000 1.111 --- src/bin/psql/describe.c 14 Feb 2005 20:05:05 -0000 *************** *** 28,35 **** #endif - #define _(x) gettext((x)) - static bool describeOneTableDetails(const char *schemaname, const char *relationname, const char *oid, --- 28,33 ---- Index: src/bin/psql/help.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/help.c,v retrieving revision 1.100 diff -c -c -r1.100 help.c *** src/bin/psql/help.c 8 Jan 2005 22:51:13 -0000 1.100 --- src/bin/psql/help.c 14 Feb 2005 20:05:06 -0000 *************** *** 31,38 **** #include "common.h" #include "sql_help.h" - #define _(x) gettext((x)) - /* * PLEASE: * If you change something in this file, also make the same changes --- 31,36 ---- *************** *** 346,353 **** "Description: %s\n" "Syntax:\n%s\n\n"), QL_HELP[i].cmd, ! gettext(QL_HELP[i].help), ! gettext(QL_HELP[i].syntax)); /* If we have an exact match, exit. Fixes \h SELECT */ if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0) break; --- 344,351 ---- "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 (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0) break; Index: src/bin/psql/large_obj.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/large_obj.c,v retrieving revision 1.35 diff -c -c -r1.35 large_obj.c *** src/bin/psql/large_obj.c 1 Jan 2005 05:43:08 -0000 1.35 --- src/bin/psql/large_obj.c 14 Feb 2005 20:05:06 -0000 *************** *** 253,259 **** " pg_catalog.obj_description(loid, 'pg_largeobject') as \"%s\"\n" "FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) x\n" "ORDER BY 1", ! gettext("Description")); res = PSQLexec(buf, false); if (!res) --- 253,259 ---- " pg_catalog.obj_description(loid, 'pg_largeobject') as \"%s\"\n" "FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) x\n" "ORDER BY 1", ! _("Description")); res = PSQLexec(buf, false); if (!res) *************** *** 261,267 **** myopt.topt.tuples_only = false; myopt.nullPrint = NULL; ! myopt.title = gettext("Large objects"); printQuery(res, &myopt, pset.queryFout); --- 261,267 ---- myopt.topt.tuples_only = false; myopt.nullPrint = NULL; ! myopt.title = _("Large objects"); printQuery(res, &myopt, pset.queryFout); Index: src/bin/psql/mainloop.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/mainloop.c,v retrieving revision 1.66 diff -c -c -r1.66 mainloop.c *** src/bin/psql/mainloop.c 1 Jan 2005 05:43:08 -0000 1.66 --- src/bin/psql/mainloop.c 14 Feb 2005 20:05:06 -0000 *************** *** 172,178 **** if (count_eof < GetVariableNum(pset.vars, "IGNOREEOF", 0, 10, false)) { if (!QUIET()) ! printf(gettext("Use \"\\q\" to leave %s.\n"), pset.progname); continue; } --- 172,178 ---- if (count_eof < GetVariableNum(pset.vars, "IGNOREEOF", 0, 10, false)) { if (!QUIET()) ! printf(_("Use \"\\q\" to leave %s.\n"), pset.progname); continue; } Index: src/bin/psql/print.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/print.c,v retrieving revision 1.54 diff -c -c -r1.54 print.c *** src/bin/psql/print.c 1 Jan 2005 05:43:08 -0000 1.54 --- src/bin/psql/print.c 14 Feb 2005 20:05:07 -0000 *************** *** 29,34 **** --- 29,35 ---- #include "mbprint.h" + /*************************/ /* Unaligned text */ /*************************/ *************** *** 227,240 **** widths = calloc(col_count, sizeof(*widths)); if (!widths) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } head_w = calloc(col_count, sizeof(*head_w)); if (!head_w) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } } --- 228,241 ---- widths = calloc(col_count, sizeof(*widths)); if (!widths) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } head_w = calloc(col_count, sizeof(*head_w)); if (!head_w) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } } *************** *** 253,259 **** cell_w = calloc(cell_count, sizeof(*cell_w)); if (!cell_w) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } } --- 254,260 ---- cell_w = calloc(cell_count, sizeof(*cell_w)); if (!cell_w) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } } *************** *** 425,431 **** if (cells[0] == NULL) { ! puts(gettext("(No rows)\n")); return; } --- 426,432 ---- if (cells[0] == NULL) { ! puts(_("(No rows)\n")); return; } *************** *** 437,443 **** head_w = calloc(col_count, sizeof(*head_w)); if (!head_w) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } } --- 438,444 ---- head_w = calloc(col_count, sizeof(*head_w)); if (!head_w) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } } *************** *** 461,467 **** cell_w = calloc(cell_count, sizeof(*cell_w)); if (!cell_w) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } } --- 462,468 ---- cell_w = calloc(cell_count, sizeof(*cell_w)); if (!cell_w) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } } *************** *** 485,491 **** divider = malloc(hwidth + dwidth + 10); if (!divider) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } divider[0] = '\0'; --- 486,492 ---- divider = malloc(hwidth + dwidth + 10); if (!divider) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } divider[0] = '\0'; *************** *** 514,520 **** if (!record_str) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } --- 515,521 ---- if (!record_str) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } *************** *** 532,538 **** if (!div_copy) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } --- 533,539 ---- if (!div_copy) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } *************** *** 1153,1159 **** headers = calloc(nfields + 1, sizeof(*headers)); if (!headers) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } --- 1154,1160 ---- headers = calloc(nfields + 1, sizeof(*headers)); if (!headers) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } *************** *** 1165,1171 **** cells = calloc(ncells + 1, sizeof(*cells)); if (!cells) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } --- 1166,1172 ---- cells = calloc(ncells + 1, sizeof(*cells)); if (!cells) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } *************** *** 1186,1205 **** footers = calloc(2, sizeof(*footers)); if (!footers) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } footers[0] = malloc(100); if (!footers[0]) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } if (PQntuples(result) == 1) ! snprintf(footers[0], 100, gettext("(1 row)")); else ! snprintf(footers[0], 100, gettext("(%d rows)"), PQntuples(result)); } else footers = NULL; --- 1187,1206 ---- footers = calloc(2, sizeof(*footers)); if (!footers) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } footers[0] = malloc(100); if (!footers[0]) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } if (PQntuples(result) == 1) ! snprintf(footers[0], 100, _("(1 row)")); else ! snprintf(footers[0], 100, _("(%d rows)"), PQntuples(result)); } else footers = NULL; *************** *** 1208,1214 **** align = calloc(nfields + 1, sizeof(*align)); if (!align) { ! fprintf(stderr, gettext("out of memory\n")); exit(EXIT_FAILURE); } --- 1209,1215 ---- align = calloc(nfields + 1, sizeof(*align)); if (!align) { ! fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); } Index: src/bin/psql/startup.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/psql/startup.c,v retrieving revision 1.112 diff -c -c -r1.112 startup.c *** src/bin/psql/startup.c 17 Jan 2005 10:00:05 -0000 1.112 --- src/bin/psql/startup.c 14 Feb 2005 20:05:07 -0000 *************** *** 38,43 **** --- 38,44 ---- #include "mb/pg_wchar.h" + /* * Global psql options */ *************** *** 135,141 **** pset.vars = CreateVariableSpace(); if (!pset.vars) { ! fprintf(stderr, gettext("%s: out of memory\n"), pset.progname); exit(EXIT_FAILURE); } pset.popt.topt.format = PRINT_ALIGNED; --- 136,142 ---- pset.vars = CreateVariableSpace(); if (!pset.vars) { ! fprintf(stderr, _("%s: out of memory\n"), pset.progname); exit(EXIT_FAILURE); } pset.popt.topt.format = PRINT_ALIGNED; *************** *** 290,296 **** if (!QUIET() && !pset.notty) { ! printf(gettext("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n" "Type: \\copyright for distribution terms\n" " \\h for help with SQL commands\n" " \\? for help with psql commands\n" --- 291,297 ---- if (!QUIET() && !pset.notty) { ! printf(_("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n" "Type: \\copyright for distribution terms\n" " \\h for help with SQL commands\n" " \\? for help with psql commands\n" *************** *** 444,450 **** if (!result) { ! fprintf(stderr, gettext("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } --- 445,451 ---- if (!result) { ! fprintf(stderr, _("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } *************** *** 490,496 **** { if (!DeleteVariable(pset.vars, value)) { ! fprintf(stderr, gettext("%s: could not delete variable \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } --- 491,497 ---- { if (!DeleteVariable(pset.vars, value)) { ! fprintf(stderr, _("%s: could not delete variable \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } *************** *** 500,506 **** *equal_loc = '\0'; if (!SetVariable(pset.vars, value, equal_loc + 1)) { ! fprintf(stderr, gettext("%s: could not set variable \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } --- 501,507 ---- *equal_loc = '\0'; if (!SetVariable(pset.vars, value, equal_loc + 1)) { ! fprintf(stderr, _("%s: could not set variable \"%s\"\n"), pset.progname, value); exit(EXIT_FAILURE); } *************** *** 531,543 **** /* unknown option reported by getopt */ else { ! fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"), pset.progname); exit(EXIT_FAILURE); } break; default: ! fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"), pset.progname); exit(EXIT_FAILURE); break; --- 532,544 ---- /* unknown option reported by getopt */ else { ! fprintf(stderr, _("Try \"%s --help\" for more information.\n"), pset.progname); exit(EXIT_FAILURE); } break; default: ! fprintf(stderr, _("Try \"%s --help\" for more information.\n"), pset.progname); exit(EXIT_FAILURE); break; *************** *** 555,568 **** else if (!options->username) options->username = argv[optind]; else if (!QUIET()) ! fprintf(stderr, gettext("%s: warning: extra command-line argument \"%s\" ignored\n"), pset.progname, argv[optind]); optind++; } if (used_old_u_option && !QUIET()) ! fprintf(stderr, gettext("%s: Warning: The -u option is deprecated. Use -U.\n"), pset.progname); } --- 556,569 ---- else if (!options->username) options->username = argv[optind]; else if (!QUIET()) ! fprintf(stderr, _("%s: warning: extra command-line argument \"%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); } *************** *** 624,630 **** puts("psql (PostgreSQL) " PG_VERSION); #if defined(USE_READLINE) ! puts(gettext("contains support for command-line editing")); #endif } --- 625,631 ---- puts("psql (PostgreSQL) " PG_VERSION); #if defined(USE_READLINE) ! puts(_("contains support for command-line editing")); #endif } *************** *** 647,653 **** return; /* no SSL */ SSL_get_cipher_bits(ssl, &sslbits); ! printf(gettext("SSL connection (cipher: %s, bits: %i)\n\n"), SSL_get_cipher(ssl), sslbits); } #endif --- 648,654 ---- return; /* no SSL */ SSL_get_cipher_bits(ssl, &sslbits); ! printf(_("SSL connection (cipher: %s, bits: %i)\n\n"), SSL_get_cipher(ssl), sslbits); } #endif *************** *** 670,676 **** concp = GetConsoleCP(); if (wincp != concp) { ! printf(gettext("Warning: Console code page (%u) differs from Windows code page (%u)\n" " 8-bit characters may not work correctly. See psql reference\n" " page \"Notes for Windows users\" for details.\n\n"), concp, wincp); --- 671,677 ---- concp = GetConsoleCP(); if (wincp != concp) { ! printf(_("Warning: Console code page (%u) differs from Windows code page (%u)\n" " 8-bit characters may not work correctly. See psql reference\n" " page \"Notes for Windows users\" for details.\n\n"), concp, wincp); Index: src/bin/scripts/common.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/scripts/common.c,v retrieving revision 1.16 diff -c -c -r1.16 common.c *** src/bin/scripts/common.c 8 Jan 2005 22:51:14 -0000 1.16 --- src/bin/scripts/common.c 14 Feb 2005 20:05:07 -0000 *************** *** 168,176 **** int check_yesno_response(const char *string) { ! if (strcmp(string, gettext(PG_YESLETTER)) == 0) return 1; ! else if (strcmp(string, gettext(PG_NOLETTER)) == 0) return 0; else return -1; --- 168,176 ---- int check_yesno_response(const char *string) { ! if (strcmp(string, _(PG_YESLETTER)) == 0) return 1; ! else if (strcmp(string, _(PG_NOLETTER)) == 0) return 0; else return -1; Index: src/bin/scripts/common.h =================================================================== RCS file: /cvsroot/pgsql/src/bin/scripts/common.h,v retrieving revision 1.9 diff -c -c -r1.9 common.h *** src/bin/scripts/common.h 27 Nov 2004 18:51:08 -0000 1.9 --- src/bin/scripts/common.h 14 Feb 2005 20:05:07 -0000 *************** *** 10,17 **** const char *get_user_name(const char *progname); - #define _(x) gettext((x)) - typedef void (*help_handler) (const char *); void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp); --- 10,15 ---- Index: src/include/c.h =================================================================== RCS file: /cvsroot/pgsql/src/include/c.h,v retrieving revision 1.178 diff -c -c -r1.178 c.h *** src/include/c.h 31 Dec 2004 22:03:18 -0000 1.178 --- src/include/c.h 14 Feb 2005 20:05:08 -0000 *************** *** 91,96 **** --- 91,98 ---- /* Must be before gettext() games below */ #include <locale.h> + #define _(x) gettext((x)) + #ifdef ENABLE_NLS #include <libintl.h> #else Index: src/interfaces/ecpg/preproc/ecpg.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v retrieving revision 1.91 diff -c -c -r1.91 ecpg.c *** src/interfaces/ecpg/preproc/ecpg.c 9 Nov 2004 15:57:55 -0000 1.91 --- src/interfaces/ecpg/preproc/ecpg.c 14 Feb 2005 20:05:09 -0000 *************** *** 34,65 **** static void help(const char *progname) { ! printf("%s is the PostgreSQL embedded SQL preprocessor for C programs.\n\n", progname); ! printf("Usage:\n" ! " %s [OPTION]... FILE...\n\n", progname); ! printf("Options:\n"); ! printf(" -c automatically generate C code from embedded SQL code;\n" ! " currently this works for EXEC SQL TYPE\n"); ! printf(" -C MODE set compatibility mode;\n" ! " MODE may be one of \"INFORMIX\", \"INFORMIX_SE\"\n"); #ifdef YYDEBUG ! printf(" -d generate parser debug output\n"); #endif ! printf(" -D SYMBOL define SYMBOL\n"); ! printf(" -h parse a header file, this option includes option \"-c\"\n"); ! printf(" -i parse system include files as well\n"); ! printf(" -I DIRECTORY search DIRECTORY for include files\n"); ! printf(" -o OUTFILE write result to OUTFILE\n"); ! printf(" -r OPTION specify runtime behaviour;\n" ! " OPTION may only be \"no_indicator\"\n"); ! printf(" -t turn on autocommit of transactions\n"); ! printf(" --help show this help, then exit\n"); ! printf(" --version output version information, then exit\n"); ! printf("\nIf no output file is specified, the name is formed by adding .c to the\n" ! "input file name, after stripping off .pgc if present.\n"); ! printf("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"); } static void --- 34,65 ---- static void help(const char *progname) { ! printf(_("%s is the PostgreSQL embedded SQL preprocessor for C programs.\n\n"), progname); ! printf(_("Usage:\n" ! " %s [OPTION]... FILE...\n\n"), progname); ! printf(_("Options:\n")); ! printf(_(" -c automatically generate C code from embedded SQL code;\n" ! " currently this works for EXEC SQL TYPE\n")); ! printf(_(" -C MODE set compatibility mode;\n" ! " MODE may be one of \"INFORMIX\", \"INFORMIX_SE\"\n")); #ifdef YYDEBUG ! printf(_(" -d generate parser debug output\n")); #endif ! printf(_(" -D SYMBOL define SYMBOL\n")); ! printf(_(" -h parse a header file, this option includes option \"-c\"\n")); ! printf(_(" -i parse system include files as well\n")); ! printf(_(" -I DIRECTORY search DIRECTORY for include files\n")); ! printf(_(" -o OUTFILE write result to OUTFILE\n")); ! printf(_(" -r OPTION specify runtime behaviour;\n" ! " OPTION may only be \"no_indicator\"\n")); ! printf(_(" -t turn on autocommit of transactions\n")); ! printf(_(" --help show this help, then exit\n")); ! printf(_(" --version output version information, then exit\n")); ! printf(_("\nIf no output file is specified, the name is formed by adding .c to the\n" ! "input file name, after stripping off .pgc if present.\n")); ! printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n")); } static void *************** *** 154,160 **** yyout = fopen(optarg, PG_BINARY_W); if (yyout == NULL) ! fprintf(stderr, "%s: could not open file \"%s\": %s\n", progname, optarg, strerror(errno)); else out_option = 1; --- 154,160 ---- yyout = fopen(optarg, PG_BINARY_W); if (yyout == NULL) ! fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, optarg, strerror(errno)); else out_option = 1; *************** *** 196,202 **** } else { ! fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); return ILLEGAL_OPTION; } break; --- 196,202 ---- } else { ! fprintf(stderr, _("Try '%s --help' for more information.\n"), argv[0]); return ILLEGAL_OPTION; } break; *************** *** 205,211 **** force_indicator = false; else { ! fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); return ILLEGAL_OPTION; } break; --- 205,211 ---- force_indicator = false; else { ! fprintf(stderr, _("Try '%s --help' for more information.\n"), argv[0]); return ILLEGAL_OPTION; } break; *************** *** 216,227 **** #ifdef YYDEBUG yydebug = 1; #else ! fprintf(stderr, "%s: parser debug support (-d) not available\n", progname); #endif break; default: ! fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); return ILLEGAL_OPTION; } } --- 216,227 ---- #ifdef YYDEBUG yydebug = 1; #else ! fprintf(stderr, _("%s: parser debug support (-d) not available\n"), progname); #endif break; default: ! fprintf(stderr, _("Try '%s --help' for more information.\n"), argv[0]); return ILLEGAL_OPTION; } } *************** *** 234,252 **** if (verbose) { ! fprintf(stderr, "%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n", progname, MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL); ! fprintf(stderr, "exec sql include ... search starts here:\n"); for (ip = include_paths; ip != NULL; ip = ip->next) fprintf(stderr, " %s\n", ip->path); ! fprintf(stderr, "end of search list\n"); return 0; } if (optind >= argc) /* no files specified */ { ! fprintf(stderr, "%s: no input files specified\n", progname); ! fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); return (ILLEGAL_OPTION); } else --- 234,252 ---- if (verbose) { ! fprintf(stderr, _("%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n"), progname, MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL); ! fprintf(stderr, _("exec sql include ... search starts here:\n")); for (ip = include_paths; ip != NULL; ip = ip->next) fprintf(stderr, " %s\n", ip->path); ! fprintf(stderr, _("end of search list\n")); return 0; } if (optind >= argc) /* no files specified */ { ! fprintf(stderr, _("%s: no input files specified\n"), progname); ! fprintf(stderr, _("Try '%s --help' for more information.\n"), argv[0]); return (ILLEGAL_OPTION); } else *************** *** 305,311 **** yyout = fopen(output_filename, PG_BINARY_W); if (yyout == NULL) { ! fprintf(stderr, "%s: could not open file \"%s\": %s\n", progname, output_filename, strerror(errno)); free(output_filename); free(input_filename); --- 305,311 ---- yyout = fopen(output_filename, PG_BINARY_W); if (yyout == NULL) { ! fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, output_filename, strerror(errno)); free(output_filename); free(input_filename); *************** *** 315,321 **** } if (yyin == NULL) ! fprintf(stderr, "%s: could not open file \"%s\": %s\n", progname, argv[fnr], strerror(errno)); else { --- 315,321 ---- } if (yyin == NULL) ! fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, argv[fnr], strerror(errno)); else { *************** *** 434,440 **** * Does not really make sense to declare a cursor * but not open it */ ! snprintf(errortext, sizeof(errortext), "cursor `%s´ has been declared but ot opened\n", ptr->name); mmerror(PARSE_ERROR, ET_WARNING, errortext); } ptr = ptr->next; --- 434,440 ---- * Does not really make sense to declare a cursor * but not open it */ ! snprintf(errortext, sizeof(errortext), _("cursor \"%s\" has been declared but ot opened\n"), ptr->name); mmerror(PARSE_ERROR, ET_WARNING, errortext); } ptr = ptr->next; Index: src/interfaces/ecpg/preproc/pgc.l =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v retrieving revision 1.135 diff -c -c -r1.135 pgc.l *** src/interfaces/ecpg/preproc/pgc.l 2 Feb 2005 15:37:43 -0000 1.135 --- src/interfaces/ecpg/preproc/pgc.l 14 Feb 2005 20:05:10 -0000 *************** *** 1162,1168 **** { if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH) { ! fprintf(stderr, "Error: Path %s/%s is too long in line %d, skipping.\n", ip->path, yytext, yylineno); continue; } snprintf (inc_file, sizeof(inc_file), "%s/%s", ip->path, yytext); --- 1162,1168 ---- { if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH) { ! fprintf(stderr, _("Error: Path %s/%s is too long in line %d, skipping.\n"), ip->path, yytext, yylineno); continue; } snprintf (inc_file, sizeof(inc_file), "%s/%s", ip->path, yytext); Index: src/interfaces/ecpg/preproc/preproc.y =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/ecpg/preproc/preproc.y,v retrieving revision 1.307 diff -c -c -r1.307 preproc.y *** src/interfaces/ecpg/preproc/preproc.y 10 Feb 2005 08:06:35 -0000 1.307 --- src/interfaces/ecpg/preproc/preproc.y 14 Feb 2005 20:05:15 -0000 *************** *** 6403,6409 **** { char buf[1024]; ! snprintf(buf,sizeof buf,"%s at or near \"%s\"", error, token_start ? token_start : yytext); buf[sizeof(buf)-1]=0; mmerror(PARSE_ERROR, ET_ERROR, buf); } --- 6403,6409 ---- { char buf[1024]; ! snprintf(buf,sizeof buf, _("%s at or near \"%s\""), error, token_start ? token_start : yytext); buf[sizeof(buf)-1]=0; mmerror(PARSE_ERROR, ET_ERROR, buf); } Index: src/interfaces/libpq/fe-connect.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v retrieving revision 1.302 diff -c -c -r1.302 fe-connect.c *** src/interfaces/libpq/fe-connect.c 26 Jan 2005 19:24:02 -0000 1.302 --- src/interfaces/libpq/fe-connect.c 14 Feb 2005 20:05:18 -0000 *************** *** 740,748 **** if (strncmp(old, "unix:", 5) != 0) { printfPQExpBuffer(&conn->errorMessage, ! "connectDBStart() -- " ! "socket name can only be specified with " ! "non-TCP\n"); return 1; } *tmp2 = '\0'; --- 740,748 ---- if (strncmp(old, "unix:", 5) != 0) { printfPQExpBuffer(&conn->errorMessage, ! libpq_gettext("connectDBStart() -- " ! "socket name can only be specified with " ! "non-TCP\n")); return 1; } *tmp2 = '\0'; *************** *** 769,777 **** if (strcmp(old + offset, "localhost") != 0) { printfPQExpBuffer(&conn->errorMessage, ! "connectDBStart() -- " "non-TCP access only possible on " ! "localhost\n"); return 1; } } --- 769,777 ---- if (strcmp(old + offset, "localhost") != 0) { printfPQExpBuffer(&conn->errorMessage, ! libpq_gettext("connectDBStart() -- " "non-TCP access only possible on " ! "localhost\n")); return 1; } } *************** *** 1514,1520 **** { /* Received error - probably protocol mismatch */ if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "Postmaster reports error, attempting fallback to pre-7.0.\n"); if (conn->sslmode[0] == 'r') /* "require" */ { /* Require SSL, but server is too old */ --- 1514,1520 ---- { /* Received error - probably protocol mismatch */ if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("Postmaster reports error, attempting fallback to pre-7.0.\n")); if (conn->sslmode[0] == 'r') /* "require" */ { /* Require SSL, but server is too old */ *************** *** 2502,2508 **** f = fopen(serviceFile, "r"); if (f == NULL) { ! printfPQExpBuffer(errorMessage, "ERROR: Service file '%s' not found\n", serviceFile); return 1; } --- 2502,2508 ---- f = fopen(serviceFile, "r"); if (f == NULL) { ! printfPQExpBuffer(errorMessage, libpq_gettext("ERROR: Service file '%s' not found\n"), serviceFile); return 1; } *************** *** 2515,2521 **** { fclose(f); printfPQExpBuffer(errorMessage, ! "ERROR: line %d too long in service file '%s'\n", linenr, serviceFile); return 2; --- 2515,2521 ---- { fclose(f); printfPQExpBuffer(errorMessage, ! libpq_gettext("ERROR: line %d too long in service file '%s'\n"), linenr, serviceFile); return 2; *************** *** 2566,2572 **** if (val == NULL) { printfPQExpBuffer(errorMessage, ! "ERROR: syntax error in service file '%s', line %d\n", serviceFile, linenr); fclose(f); --- 2566,2572 ---- if (val == NULL) { printfPQExpBuffer(errorMessage, ! libpq_gettext("ERROR: syntax error in service file '%s', line %d\n"), serviceFile, linenr); fclose(f); *************** *** 2593,2599 **** if (!found_keyword) { printfPQExpBuffer(errorMessage, ! "ERROR: syntax error in service file '%s', line %d\n", serviceFile, linenr); fclose(f); --- 2593,2599 ---- if (!found_keyword) { printfPQExpBuffer(errorMessage, ! libpq_gettext("ERROR: syntax error in service file '%s', line %d\n"), serviceFile, linenr); fclose(f); Index: src/interfaces/libpq/fe-misc.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v retrieving revision 1.112 diff -c -c -r1.112 fe-misc.c *** src/interfaces/libpq/fe-misc.c 31 Dec 2004 22:03:50 -0000 1.112 --- src/interfaces/libpq/fe-misc.c 14 Feb 2005 20:05:18 -0000 *************** *** 85,91 **** *result = conn->inBuffer[conn->inCursor++]; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "From backend> %c\n", *result); return 0; } --- 85,91 ---- *result = conn->inBuffer[conn->inCursor++]; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("From backend> %c\n"), *result); return 0; } *************** *** 101,107 **** return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend> %c\n", c); return 0; } --- 101,107 ---- return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend> %c\n"), c); return 0; } *************** *** 137,143 **** conn->inCursor = ++inCursor; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "From backend> \"%s\"\n", buf->data); return 0; --- 137,143 ---- conn->inCursor = ++inCursor; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("From backend> \"%s\"\n"), buf->data); return 0; *************** *** 154,160 **** return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend> '%s'\n", s); return 0; } --- 154,160 ---- return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend> '%s'\n"), s); return 0; } *************** *** 175,181 **** conn->inCursor += len; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "From backend (%lu)> %.*s\n", (unsigned long) len, (int) len, s); return 0; } --- 175,181 ---- conn->inCursor += len; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("From backend (%lu)> %.*s\n"), (unsigned long) len, (int) len, s); return 0; } *************** *** 191,197 **** return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend> %.*s\n", (int) len, s); return 0; } --- 191,197 ---- return EOF; if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend> %.*s\n"), (int) len, s); return 0; } *************** *** 231,237 **** } if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "From backend (#%lu)> %d\n", (unsigned long) bytes, *result); return 0; } --- 231,237 ---- } if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("From backend (#%lu)> %d\n"), (unsigned long) bytes, *result); return 0; } *************** *** 267,273 **** } if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend (%lu#)> %d\n", (unsigned long) bytes, value); return 0; } --- 267,273 ---- } if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend (%lu#)> %d\n"), (unsigned long) bytes, value); return 0; } *************** *** 455,461 **** /* length word, if needed, will be filled in by pqPutMsgEnd */ if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend> Msg %c\n", msg_type ? msg_type : ' '); return 0; --- 455,461 ---- /* length word, if needed, will be filled in by pqPutMsgEnd */ if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend> Msg %c\n"), msg_type ? msg_type : ' '); return 0; *************** *** 493,499 **** pqPutMsgEnd(PGconn *conn) { if (conn->Pfdebug) ! fprintf(conn->Pfdebug, "To backend> Msg complete, length %u\n", conn->outMsgEnd - conn->outCount); /* Fill in length word if needed */ --- 493,499 ---- pqPutMsgEnd(PGconn *conn) { if (conn->Pfdebug) ! fprintf(conn->Pfdebug, libpq_gettext("To backend> Msg complete, length %u\n"), conn->outMsgEnd - conn->outCount); /* Fill in length word if needed */ Index: src/interfaces/libpq/fe-print.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v retrieving revision 1.58 diff -c -c -r1.58 fe-print.c *** src/interfaces/libpq/fe-print.c 31 Dec 2004 22:03:50 -0000 1.58 --- src/interfaces/libpq/fe-print.c 14 Feb 2005 20:05:19 -0000 *************** *** 219,228 **** if (po->expanded) { if (po->align) ! fprintf(fout, "%-*s%s Value\n", ! fieldMaxLen - fs_len, "Field", po->fieldSep); else ! fprintf(fout, "%s%sValue\n", "Field", po->fieldSep); } else { --- 219,228 ---- if (po->expanded) { if (po->align) ! fprintf(fout, libpq_gettext("%-*s%s Value\n"), ! fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep); else ! fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep); } else { *************** *** 262,268 **** "<table %s><caption align=high>%d</caption>\n", po->tableOpt ? po->tableOpt : "", i); else ! fprintf(fout, "-- RECORD %d --\n", i); } for (j = 0; j < nFields; j++) do_field(po, res, i, j, fs_len, fields, nFields, --- 262,268 ---- "<table %s><caption align=high>%d</caption>\n", po->tableOpt ? po->tableOpt : "", i); else ! fprintf(fout, libpq_gettext("-- RECORD %d --\n"), i); } for (j = 0; j < nFields; j++) do_field(po, res, i, j, fs_len, fields, nFields, Index: src/interfaces/libpq/win32.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/win32.c,v retrieving revision 1.12 diff -c -c -r1.12 win32.c *** src/interfaces/libpq/win32.c 31 Dec 2004 22:03:50 -0000 1.12 --- src/interfaces/libpq/win32.c 14 Feb 2005 20:05:19 -0000 *************** *** 309,315 **** } if (!success) ! sprintf(strerrbuf, "Unknown socket error (0x%08X/%i)", err, err); else { strerrbuf[buflen - 1] = '\0'; --- 309,315 ---- } if (!success) ! sprintf(strerrbuf, libpq_gettext("Unknown socket error (0x%08X/%i)"), err, err); else { strerrbuf[buflen - 1] = '\0'; Index: src/pl/plperl/SPI.xs =================================================================== RCS file: /cvsroot/pgsql/src/pl/plperl/SPI.xs,v retrieving revision 1.11 diff -c -c -r1.11 SPI.xs *** src/pl/plperl/SPI.xs 21 Nov 2004 22:13:37 -0000 1.11 --- src/pl/plperl/SPI.xs 14 Feb 2005 20:05:19 -0000 *************** *** 1,5 **** --- 1,7 ---- /* this must be first: */ #include "postgres.h" + /* Defined by Perl */ + #undef _(x) /* perl stuff */ #include "EXTERN.h" Index: src/pl/plperl/plperl.c =================================================================== RCS file: /cvsroot/pgsql/src/pl/plperl/plperl.c,v retrieving revision 1.67 diff -c -c -r1.67 plperl.c *** src/pl/plperl/plperl.c 14 Jan 2005 16:25:42 -0000 1.67 --- src/pl/plperl/plperl.c 14 Feb 2005 20:05:20 -0000 *************** *** 38,43 **** --- 38,45 ---- **********************************************************************/ #include "postgres.h" + /* Defined by Perl */ + #undef _(x) /* system stuff */ #include <ctype.h> Index: src/pl/plperl/spi_internal.c =================================================================== RCS file: /cvsroot/pgsql/src/pl/plperl/spi_internal.c,v retrieving revision 1.5 diff -c -c -r1.5 spi_internal.c *** src/pl/plperl/spi_internal.c 13 Sep 2004 20:08:59 -0000 1.5 --- src/pl/plperl/spi_internal.c 14 Feb 2005 20:05:20 -0000 *************** *** 5,10 **** --- 5,12 ---- */ #include "postgres.h" + /* Defined by Perl */ + #undef _(x) #include "spi_internal.h" Index: src/pl/plpgsql/src/pl_exec.c =================================================================== RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v retrieving revision 1.128 diff -c -c -r1.128 pl_exec.c *** src/pl/plpgsql/src/pl_exec.c 1 Feb 2005 19:35:14 -0000 1.128 --- src/pl/plpgsql/src/pl_exec.c 14 Feb 2005 20:05:23 -0000 *************** *** 746,752 **** */ errcontext("PL/pgSQL function \"%s\" %s", estate->err_func->fn_name, ! gettext(estate->err_text)); } else errcontext("PL/pgSQL function \"%s\"", --- 746,752 ---- */ errcontext("PL/pgSQL function \"%s\" %s", estate->err_func->fn_name, ! _(estate->err_text)); } else errcontext("PL/pgSQL function \"%s\"", Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql/src/port/dirmod.c,v retrieving revision 1.35 diff -c -c -r1.35 dirmod.c *** src/port/dirmod.c 13 Feb 2005 16:50:44 -0000 1.35 --- src/port/dirmod.c 14 Feb 2005 20:05:24 -0000 *************** *** 40,45 **** --- 40,46 ---- #endif #endif + #ifndef FRONTEND /* *************** *** 72,78 **** if ((res = malloc(size)) == NULL) { ! fprintf(stderr, gettext("out of memory\n")); exit(1); } return res; --- 73,79 ---- if ((res = malloc(size)) == NULL) { ! fprintf(stderr, _("out of memory\n")); exit(1); } return res; *************** *** 85,91 **** if ((res = strdup(string)) == NULL) { ! fprintf(stderr, gettext("out of memory\n")); exit(1); } return res; --- 86,92 ---- if ((res = strdup(string)) == NULL) { ! fprintf(stderr, _("out of memory\n")); exit(1); } return res; *************** *** 98,104 **** if ((res = realloc(pointer, size)) == NULL) { ! fprintf(stderr, gettext("out of memory\n")); exit(1); } return res; --- 99,105 ---- if ((res = realloc(pointer, size)) == NULL) { ! fprintf(stderr, _("out of memory\n")); exit(1); } return res; *************** *** 139,145 **** elog(LOG, "could not rename \"%s\" to \"%s\", continuing to try", from, to); #else ! fprintf(stderr, "could not rename \"%s\" to \"%s\", continuing to try\n", from, to); #endif loops++; --- 140,146 ---- elog(LOG, "could not rename \"%s\" to \"%s\", continuing to try", from, to); #else ! fprintf(stderr, _("could not rename \"%s\" to \"%s\", continuing to try\n"), from, to); #endif loops++; *************** *** 149,155 **** #ifndef FRONTEND elog(LOG, "completed rename of \"%s\" to \"%s\"", from, to); #else ! fprintf(stderr, "completed rename of \"%s\" to \"%s\"\n", from, to); #endif return 0; } --- 150,156 ---- #ifndef FRONTEND elog(LOG, "completed rename of \"%s\" to \"%s\"", from, to); #else ! fprintf(stderr, _("completed rename of \"%s\" to \"%s\"\n"), from, to); #endif return 0; } *************** *** 175,181 **** elog(LOG, "could not unlink \"%s\", continuing to try", path); #else ! fprintf(stderr, "could not unlink \"%s\", continuing to try\n", path); #endif loops++; --- 176,182 ---- elog(LOG, "could not unlink \"%s\", continuing to try", path); #else ! fprintf(stderr, _("could not unlink \"%s\", continuing to try\n"), path); #endif loops++; *************** *** 185,191 **** #ifndef FRONTEND elog(LOG, "completed unlink of \"%s\"", path); #else ! fprintf(stderr, "completed unlink of \"%s\"\n", path); #endif return 0; } --- 186,192 ---- #ifndef FRONTEND elog(LOG, "completed unlink of \"%s\"", path); #else ! fprintf(stderr, _("completed unlink of \"%s\"\n"), path); #endif return 0; } *************** *** 283,289 **** errmsg("Error setting junction for %s: %s", nativeTarget, msg))); #else ! fprintf(stderr, "Error setting junction for %s: %s\n", nativeTarget, msg); #endif LocalFree(msg); --- 284,290 ---- errmsg("Error setting junction for %s: %s", nativeTarget, msg))); #else ! fprintf(stderr, _("Error setting junction for %s: %s\n"), nativeTarget, msg); #endif LocalFree(msg); *************** *** 433,439 **** #ifndef FRONTEND elog(WARNING, "could not remove file or directory \"%s\": %m", filepath); #else ! fprintf(stderr, "could not remove file or directory \"%s\": %s\n", filepath, strerror(errno)); #endif fnames_cleanup(filenames); return false; --- 434,440 ---- #ifndef FRONTEND elog(WARNING, "could not remove file or directory \"%s\": %m", filepath); #else ! fprintf(stderr, _("could not remove file or directory \"%s\": %s\n"), filepath, strerror(errno)); #endif fnames_cleanup(filenames); return false; Index: src/port/exec.c =================================================================== RCS file: /cvsroot/pgsql/src/port/exec.c,v retrieving revision 1.37 diff -c -c -r1.37 exec.c *** src/port/exec.c 14 Jan 2005 17:47:49 -0000 1.37 --- src/port/exec.c 14 Feb 2005 20:05:24 -0000 *************** *** 191,197 **** if (!getcwd(cwd, MAXPGPATH)) { ! log_error(gettext("could not identify current directory: %s"), strerror(errno)); return -1; } --- 191,197 ---- if (!getcwd(cwd, MAXPGPATH)) { ! log_error(_("could not identify current directory: %s"), strerror(errno)); return -1; } *************** *** 210,216 **** if (validate_exec(retpath) == 0) return resolve_symlinks(retpath); ! log_error(gettext("invalid binary \"%s\""), retpath); return -1; } --- 210,216 ---- if (validate_exec(retpath) == 0) return resolve_symlinks(retpath); ! log_error(_("invalid binary \"%s\""), retpath); return -1; } *************** *** 259,272 **** case -1: /* wasn't even a candidate, keep looking */ break; case -2: /* found but disqualified */ ! log_error(gettext("could not read binary \"%s\""), retpath); break; } } while (*endp); } ! log_error(gettext("could not find a \"%s\" to execute"), argv0); return -1; } --- 259,272 ---- case -1: /* wasn't even a candidate, keep looking */ break; case -2: /* found but disqualified */ ! log_error(_("could not read binary \"%s\""), retpath); break; } } while (*endp); } ! log_error(_("could not find a \"%s\" to execute"), argv0); return -1; } *************** *** 305,311 **** */ if (!getcwd(orig_wd, MAXPGPATH)) { ! log_error(gettext("could not identify current directory: %s"), strerror(errno)); return -1; } --- 305,311 ---- */ if (!getcwd(orig_wd, MAXPGPATH)) { ! log_error(_("could not identify current directory: %s"), strerror(errno)); return -1; } *************** *** 321,327 **** *lsep = '\0'; if (chdir(path) == -1) { ! log_error(gettext("could not change directory to \"%s\""), path); return -1; } fname = lsep + 1; --- 321,327 ---- *lsep = '\0'; if (chdir(path) == -1) { ! log_error(_("could not change directory to \"%s\""), path); return -1; } fname = lsep + 1; *************** *** 336,342 **** rllen = readlink(fname, link_buf, sizeof(link_buf)); if (rllen < 0 || rllen >= sizeof(link_buf)) { ! log_error(gettext("could not read symbolic link \"%s\""), fname); return -1; } link_buf[rllen] = '\0'; --- 336,342 ---- rllen = readlink(fname, link_buf, sizeof(link_buf)); if (rllen < 0 || rllen >= sizeof(link_buf)) { ! log_error(_("could not read symbolic link \"%s\""), fname); return -1; } link_buf[rllen] = '\0'; *************** *** 348,354 **** if (!getcwd(path, MAXPGPATH)) { ! log_error(gettext("could not identify current directory: %s"), strerror(errno)); return -1; } --- 348,354 ---- if (!getcwd(path, MAXPGPATH)) { ! log_error(_("could not identify current directory: %s"), strerror(errno)); return -1; } *************** *** 357,363 **** if (chdir(orig_wd) == -1) { ! log_error(gettext("could not change directory to \"%s\""), orig_wd); return -1; } --- 357,363 ---- if (chdir(orig_wd) == -1) { ! log_error(_("could not change directory to \"%s\""), orig_wd); return -1; } *************** *** 584,596 **** perror("pclose failed"); } else if (WIFEXITED(exitstatus)) ! log_error(gettext("child process exited with exit code %d"), WEXITSTATUS(exitstatus)); else if (WIFSIGNALED(exitstatus)) ! log_error(gettext("child process was terminated by signal %d"), WTERMSIG(exitstatus)); else ! log_error(gettext("child process exited with unrecognized status %d"), exitstatus); return -1; --- 584,596 ---- perror("pclose failed"); } else if (WIFEXITED(exitstatus)) ! log_error(_("child process exited with exit code %d"), WEXITSTATUS(exitstatus)); else if (WIFSIGNALED(exitstatus)) ! log_error(_("child process was terminated by signal %d"), WTERMSIG(exitstatus)); else ! log_error(_("child process exited with unrecognized status %d"), exitstatus); return -1; Index: src/port/sprompt.c =================================================================== RCS file: /cvsroot/pgsql/src/port/sprompt.c,v retrieving revision 1.10 diff -c -c -r1.10 sprompt.c *** src/port/sprompt.c 31 Dec 2004 22:03:53 -0000 1.10 --- src/port/sprompt.c 14 Feb 2005 20:05:25 -0000 *************** *** 103,109 **** if (prompt) { ! fputs(gettext(prompt), termout); fflush(termout); } --- 103,109 ---- if (prompt) { ! fputs(_(prompt), termout); fflush(termout); } Index: src/port/strerror.c =================================================================== RCS file: /cvsroot/pgsql/src/port/strerror.c,v retrieving revision 1.3 diff -c -c -r1.3 strerror.c *** src/port/strerror.c 29 Nov 2003 22:41:31 -0000 1.3 --- src/port/strerror.c 14 Feb 2005 20:05:25 -0000 *************** *** 23,29 **** if (errnum < 0 || errnum > sys_nerr) { ! sprintf(buf, "unrecognized error %d", errnum); return buf; } --- 23,29 ---- if (errnum < 0 || errnum > sys_nerr) { ! sprintf(buf, _("unrecognized error %d"), errnum); return buf; } Index: src/timezone/private.h =================================================================== RCS file: /cvsroot/pgsql/src/timezone/private.h,v retrieving revision 1.9 diff -c -c -r1.9 private.h *** src/timezone/private.h 29 Aug 2004 05:07:02 -0000 1.9 --- src/timezone/private.h 14 Feb 2005 20:05:25 -0000 *************** *** 104,109 **** --- 104,110 ---- ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type)) #endif /* !defined INT_STRLEN_MAXIMUM */ + #undef _(x) #define _(msgid) (msgid) /*
pgsql-patches by date: