summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorBruce Momjian2005-02-22 04:43:23 +0000
committerBruce Momjian2005-02-22 04:43:23 +0000
commit0542b1e2fee5fe7c7fa1a83fa9fe81618b2bc69e (patch)
treeeb42bea6234c92d377cb52257855b4b882120e78 /src/port
parent64011b4dce7db05bd7bb1911fe81fcc8f2da75e1 (diff)
Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
Diffstat (limited to 'src/port')
-rw-r--r--src/port/dirmod.c21
-rw-r--r--src/port/exec.c26
-rw-r--r--src/port/sprompt.c4
-rw-r--r--src/port/strerror.c4
4 files changed, 28 insertions, 27 deletions
diff --git a/src/port/dirmod.c b/src/port/dirmod.c
index ce47e722f4b..776a6e0a6ff 100644
--- a/src/port/dirmod.c
+++ b/src/port/dirmod.c
@@ -10,7 +10,7 @@
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.35 2005/02/13 16:50:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.36 2005/02/22 04:43:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,6 +40,7 @@
#endif
#endif
+
#ifndef FRONTEND
/*
@@ -72,7 +73,7 @@ fe_palloc(Size size)
if ((res = malloc(size)) == NULL)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(1);
}
return res;
@@ -85,7 +86,7 @@ fe_pstrdup(const char *string)
if ((res = strdup(string)) == NULL)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(1);
}
return res;
@@ -98,7 +99,7 @@ fe_repalloc(void *pointer, Size size)
if ((res = realloc(pointer, size)) == NULL)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(1);
}
return res;
@@ -139,7 +140,7 @@ pgrename(const char *from, const char *to)
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",
+ fprintf(stderr, _("could not rename \"%s\" to \"%s\", continuing to try\n"),
from, to);
#endif
loops++;
@@ -149,7 +150,7 @@ pgrename(const char *from, const char *to)
#ifndef FRONTEND
elog(LOG, "completed rename of \"%s\" to \"%s\"", from, to);
#else
- fprintf(stderr, "completed rename of \"%s\" to \"%s\"\n", from, to);
+ fprintf(stderr, _("completed rename of \"%s\" to \"%s\"\n"), from, to);
#endif
return 0;
}
@@ -175,7 +176,7 @@ pgunlink(const char *path)
elog(LOG, "could not unlink \"%s\", continuing to try",
path);
#else
- fprintf(stderr, "could not unlink \"%s\", continuing to try\n",
+ fprintf(stderr, _("could not unlink \"%s\", continuing to try\n"),
path);
#endif
loops++;
@@ -185,7 +186,7 @@ pgunlink(const char *path)
#ifndef FRONTEND
elog(LOG, "completed unlink of \"%s\"", path);
#else
- fprintf(stderr, "completed unlink of \"%s\"\n", path);
+ fprintf(stderr, _("completed unlink of \"%s\"\n"), path);
#endif
return 0;
}
@@ -283,7 +284,7 @@ pgsymlink(const char *oldpath, const char *newpath)
errmsg("Error setting junction for %s: %s",
nativeTarget, msg)));
#else
- fprintf(stderr, "Error setting junction for %s: %s\n",
+ fprintf(stderr, _("Error setting junction for %s: %s\n"),
nativeTarget, msg);
#endif
LocalFree(msg);
@@ -433,7 +434,7 @@ report_and_fail:
#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));
+ fprintf(stderr, _("could not remove file or directory \"%s\": %s\n"), filepath, strerror(errno));
#endif
fnames_cleanup(filenames);
return false;
diff --git a/src/port/exec.c b/src/port/exec.c
index 355be22574e..8220536c038 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.37 2005/01/14 17:47:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.38 2005/02/22 04:43:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -191,7 +191,7 @@ find_my_exec(const char *argv0, char *retpath)
if (!getcwd(cwd, MAXPGPATH))
{
- log_error(gettext("could not identify current directory: %s"),
+ log_error(_("could not identify current directory: %s"),
strerror(errno));
return -1;
}
@@ -210,7 +210,7 @@ find_my_exec(const char *argv0, char *retpath)
if (validate_exec(retpath) == 0)
return resolve_symlinks(retpath);
- log_error(gettext("invalid binary \"%s\""), retpath);
+ log_error(_("invalid binary \"%s\""), retpath);
return -1;
}
@@ -259,14 +259,14 @@ find_my_exec(const char *argv0, char *retpath)
case -1: /* wasn't even a candidate, keep looking */
break;
case -2: /* found but disqualified */
- log_error(gettext("could not read binary \"%s\""),
+ log_error(_("could not read binary \"%s\""),
retpath);
break;
}
} while (*endp);
}
- log_error(gettext("could not find a \"%s\" to execute"), argv0);
+ log_error(_("could not find a \"%s\" to execute"), argv0);
return -1;
}
@@ -305,7 +305,7 @@ resolve_symlinks(char *path)
*/
if (!getcwd(orig_wd, MAXPGPATH))
{
- log_error(gettext("could not identify current directory: %s"),
+ log_error(_("could not identify current directory: %s"),
strerror(errno));
return -1;
}
@@ -321,7 +321,7 @@ resolve_symlinks(char *path)
*lsep = '\0';
if (chdir(path) == -1)
{
- log_error(gettext("could not change directory to \"%s\""), path);
+ log_error(_("could not change directory to \"%s\""), path);
return -1;
}
fname = lsep + 1;
@@ -336,7 +336,7 @@ resolve_symlinks(char *path)
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);
+ log_error(_("could not read symbolic link \"%s\""), fname);
return -1;
}
link_buf[rllen] = '\0';
@@ -348,7 +348,7 @@ resolve_symlinks(char *path)
if (!getcwd(path, MAXPGPATH))
{
- log_error(gettext("could not identify current directory: %s"),
+ log_error(_("could not identify current directory: %s"),
strerror(errno));
return -1;
}
@@ -357,7 +357,7 @@ resolve_symlinks(char *path)
if (chdir(orig_wd) == -1)
{
- log_error(gettext("could not change directory to \"%s\""), orig_wd);
+ log_error(_("could not change directory to \"%s\""), orig_wd);
return -1;
}
@@ -584,13 +584,13 @@ pclose_check(FILE *stream)
perror("pclose failed");
}
else if (WIFEXITED(exitstatus))
- log_error(gettext("child process exited with exit code %d"),
+ log_error(_("child process exited with exit code %d"),
WEXITSTATUS(exitstatus));
else if (WIFSIGNALED(exitstatus))
- log_error(gettext("child process was terminated by signal %d"),
+ log_error(_("child process was terminated by signal %d"),
WTERMSIG(exitstatus));
else
- log_error(gettext("child process exited with unrecognized status %d"),
+ log_error(_("child process exited with unrecognized status %d"),
exitstatus);
return -1;
diff --git a/src/port/sprompt.c b/src/port/sprompt.c
index 9a6bee53b9f..3b97eea7ec6 100644
--- a/src/port/sprompt.c
+++ b/src/port/sprompt.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/sprompt.c,v 1.10 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/sprompt.c,v 1.11 2005/02/22 04:43:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,7 +103,7 @@ simple_prompt(const char *prompt, int maxlen, bool echo)
if (prompt)
{
- fputs(gettext(prompt), termout);
+ fputs(_(prompt), termout);
fflush(termout);
}
diff --git a/src/port/strerror.c b/src/port/strerror.c
index 414ea8aec39..00de19b62d5 100644
--- a/src/port/strerror.c
+++ b/src/port/strerror.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/port/strerror.c,v 1.3 2003/11/29 22:41:31 pgsql Exp $ */
+/* $PostgreSQL: pgsql/src/port/strerror.c,v 1.4 2005/02/22 04:43:16 momjian Exp $ */
/*
* strerror - map error number to descriptive string
@@ -23,7 +23,7 @@ strerror(int errnum)
if (errnum < 0 || errnum > sys_nerr)
{
- sprintf(buf, "unrecognized error %d", errnum);
+ sprintf(buf, _("unrecognized error %d"), errnum);
return buf;
}