Commit 99b735cc authored by Peter Eisentraut's avatar Peter Eisentraut

Work around lack of NLS support in libpgport by making those components

who use it scan the relevant source files for their own catalog.  It
creates a bit of duplicate work for translators, but it gets the job done
for now.
parent a420b76c
# $PostgreSQL: pgsql/src/backend/nls.mk,v 1.15 2004/08/11 09:00:27 petere Exp $ # $PostgreSQL: pgsql/src/backend/nls.mk,v 1.16 2004/11/27 22:44:10 petere Exp $
CATALOG_NAME := postgres CATALOG_NAME := postgres
AVAIL_LANGUAGES := af cs de es fr hr hu it nb pt_BR ru sk sv tr zh_CN zh_TW AVAIL_LANGUAGES := af cs de es fr hr hu it nb pt_BR ru sk sv tr zh_CN zh_TW
GETTEXT_FILES := + gettext-files GETTEXT_FILES := + gettext-files
...@@ -7,7 +7,7 @@ GETTEXT_FILES := + gettext-files ...@@ -7,7 +7,7 @@ GETTEXT_FILES := + gettext-files
GETTEXT_TRIGGERS:= errmsg errdetail errhint errcontext write_stderr yyerror GETTEXT_TRIGGERS:= errmsg errdetail errhint errcontext write_stderr yyerror
gettext-files: distprep gettext-files: distprep
find $(srcdir)/ -name '*.c' -print >$@ find $(srcdir)/ $(srcdir)/../port/ -name '*.c' -print >$@
my-maintainer-clean: my-maintainer-clean:
rm -f gettext-files rm -f gettext-files
......
# $PostgreSQL: pgsql/src/bin/initdb/nls.mk,v 1.15 2004/11/16 22:43:48 petere Exp $ # $PostgreSQL: pgsql/src/bin/initdb/nls.mk,v 1.16 2004/11/27 22:44:11 petere Exp $
CATALOG_NAME := initdb CATALOG_NAME := initdb
AVAIL_LANGUAGES := cs de es fr it pt_BR ro ru sk sl sv tr zh_CN zh_TW AVAIL_LANGUAGES := cs de es fr it pt_BR ro ru sk sl sv tr zh_CN zh_TW
GETTEXT_FILES := initdb.c GETTEXT_FILES := initdb.c ../../port/dirmod.c ../../port/exec.c
GETTEXT_TRIGGERS:= _ simple_prompt GETTEXT_TRIGGERS:= _ simple_prompt
# $PostgreSQL: pgsql/src/bin/pg_config/nls.mk,v 1.11 2004/11/23 23:13:07 petere Exp $ # $PostgreSQL: pgsql/src/bin/pg_config/nls.mk,v 1.12 2004/11/27 22:44:12 petere Exp $
CATALOG_NAME := pg_config CATALOG_NAME := pg_config
AVAIL_LANGUAGES := cs de es fr pt_BR ro ru sl sv tr zh_TW AVAIL_LANGUAGES := cs de es fr pt_BR ro ru sl sv tr zh_TW
GETTEXT_FILES := pg_config.c GETTEXT_FILES := pg_config.c ../../port/exec.c
GETTEXT_TRIGGERS:= _ GETTEXT_TRIGGERS:= _
# $PostgreSQL: pgsql/src/bin/pg_ctl/nls.mk,v 1.13 2004/11/23 23:13:18 petere Exp $ # $PostgreSQL: pgsql/src/bin/pg_ctl/nls.mk,v 1.14 2004/11/27 22:44:13 petere Exp $
CATALOG_NAME := pg_ctl CATALOG_NAME := pg_ctl
AVAIL_LANGUAGES := cs de es fr pt_BR ro ru sk sl sv tr zh_CN zh_TW AVAIL_LANGUAGES := cs de es fr pt_BR ro ru sk sl sv tr zh_CN zh_TW
GETTEXT_FILES := pg_ctl.c GETTEXT_FILES := pg_ctl.c ../../port/exec.c
GETTEXT_TRIGGERS:= _ simple_prompt GETTEXT_TRIGGERS:= _ simple_prompt
# $PostgreSQL: pgsql/src/bin/pg_dump/nls.mk,v 1.17 2004/11/18 10:09:58 petere Exp $ # $PostgreSQL: pgsql/src/bin/pg_dump/nls.mk,v 1.18 2004/11/27 22:44:13 petere Exp $
CATALOG_NAME := pg_dump CATALOG_NAME := pg_dump
AVAIL_LANGUAGES := cs de es fr it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW AVAIL_LANGUAGES := cs de es fr it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW
GETTEXT_FILES := pg_dump.c common.c pg_backup_archiver.c pg_backup_custom.c \ GETTEXT_FILES := pg_dump.c common.c pg_backup_archiver.c pg_backup_custom.c \
pg_backup_db.c pg_backup_files.c pg_backup_null.c \ pg_backup_db.c pg_backup_files.c pg_backup_null.c \
pg_backup_tar.c pg_restore.c pg_dumpall.c pg_backup_tar.c pg_restore.c pg_dumpall.c \
../../port/exec.c
GETTEXT_TRIGGERS:= write_msg:2 die_horribly:3 exit_horribly:3 simple_prompt \ GETTEXT_TRIGGERS:= write_msg:2 die_horribly:3 exit_horribly:3 simple_prompt \
ExecuteSqlCommand:3 ahlog:3 _ ExecuteSqlCommand:3 ahlog:3 _
# $PostgreSQL: pgsql/src/bin/psql/nls.mk,v 1.19 2004/11/07 23:38:15 petere Exp $ # $PostgreSQL: pgsql/src/bin/psql/nls.mk,v 1.20 2004/11/27 22:44:14 petere Exp $
CATALOG_NAME := psql CATALOG_NAME := psql
AVAIL_LANGUAGES := cs de es fa fr hu it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW AVAIL_LANGUAGES := cs de es fa fr hu it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW
GETTEXT_FILES := command.c common.c copy.c help.c input.c large_obj.c \ GETTEXT_FILES := command.c common.c copy.c help.c input.c large_obj.c \
mainloop.c print.c startup.c describe.c sql_help.h mainloop.c print.c startup.c describe.c sql_help.h \
../../port/exec.c
GETTEXT_TRIGGERS:= _ N_ psql_error simple_prompt GETTEXT_TRIGGERS:= _ N_ psql_error simple_prompt
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me. * Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.32 2004/10/28 22:09:31 tgl Exp $ * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.33 2004/11/27 22:44:15 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
#endif #endif
#endif #endif
#define _(x) gettext((x))
#ifndef FRONTEND #ifndef FRONTEND
/* /*
...@@ -74,7 +72,7 @@ fe_palloc(Size size) ...@@ -74,7 +72,7 @@ fe_palloc(Size size)
if ((res = malloc(size)) == NULL) if ((res = malloc(size)) == NULL)
{ {
fprintf(stderr, _("out of memory\n")); fprintf(stderr, gettext("out of memory\n"));
exit(1); exit(1);
} }
return res; return res;
...@@ -87,7 +85,7 @@ fe_pstrdup(const char *string) ...@@ -87,7 +85,7 @@ fe_pstrdup(const char *string)
if ((res = strdup(string)) == NULL) if ((res = strdup(string)) == NULL)
{ {
fprintf(stderr, _("out of memory\n")); fprintf(stderr, gettext("out of memory\n"));
exit(1); exit(1);
} }
return res; return res;
...@@ -100,7 +98,7 @@ fe_repalloc(void *pointer, Size size) ...@@ -100,7 +98,7 @@ fe_repalloc(void *pointer, Size size)
if ((res = realloc(pointer, size)) == NULL) if ((res = realloc(pointer, size)) == NULL)
{ {
fprintf(stderr, _("out of memory\n")); fprintf(stderr, gettext("out of memory\n"));
exit(1); exit(1);
} }
return res; return res;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.32 2004/11/06 23:06:29 tgl Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.33 2004/11/27 22:44:15 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#define _(x) gettext(x)
#ifndef S_IRUSR /* XXX [TRH] should be in a header */ #ifndef S_IRUSR /* XXX [TRH] should be in a header */
#define S_IRUSR S_IREAD #define S_IRUSR S_IREAD
#define S_IWUSR S_IWRITE #define S_IWUSR S_IWRITE
...@@ -192,7 +190,7 @@ find_my_exec(const char *argv0, char *retpath) ...@@ -192,7 +190,7 @@ find_my_exec(const char *argv0, char *retpath)
if (!getcwd(cwd, MAXPGPATH)) if (!getcwd(cwd, MAXPGPATH))
{ {
log_error(_("could not identify current directory: %s"), log_error(gettext("could not identify current directory: %s"),
strerror(errno)); strerror(errno));
return -1; return -1;
} }
...@@ -306,7 +304,7 @@ resolve_symlinks(char *path) ...@@ -306,7 +304,7 @@ resolve_symlinks(char *path)
*/ */
if (!getcwd(orig_wd, MAXPGPATH)) if (!getcwd(orig_wd, MAXPGPATH))
{ {
log_error(_("could not identify current directory: %s"), log_error(gettext("could not identify current directory: %s"),
strerror(errno)); strerror(errno));
return -1; return -1;
} }
...@@ -322,7 +320,7 @@ resolve_symlinks(char *path) ...@@ -322,7 +320,7 @@ resolve_symlinks(char *path)
*lsep = '\0'; *lsep = '\0';
if (chdir(path) == -1) if (chdir(path) == -1)
{ {
log_error(_("could not change directory to \"%s\""), path); log_error(gettext("could not change directory to \"%s\""), path);
return -1; return -1;
} }
fname = lsep + 1; fname = lsep + 1;
...@@ -337,7 +335,7 @@ resolve_symlinks(char *path) ...@@ -337,7 +335,7 @@ resolve_symlinks(char *path)
rllen = readlink(fname, link_buf, sizeof(link_buf)); rllen = readlink(fname, link_buf, sizeof(link_buf));
if (rllen < 0 || rllen >= sizeof(link_buf)) if (rllen < 0 || rllen >= sizeof(link_buf))
{ {
log_error(_("could not read symbolic link \"%s\""), fname); log_error(gettext("could not read symbolic link \"%s\""), fname);
return -1; return -1;
} }
link_buf[rllen] = '\0'; link_buf[rllen] = '\0';
...@@ -349,7 +347,7 @@ resolve_symlinks(char *path) ...@@ -349,7 +347,7 @@ resolve_symlinks(char *path)
if (!getcwd(path, MAXPGPATH)) if (!getcwd(path, MAXPGPATH))
{ {
log_error(_("could not identify current directory: %s"), log_error(gettext("could not identify current directory: %s"),
strerror(errno)); strerror(errno));
return -1; return -1;
} }
...@@ -358,7 +356,7 @@ resolve_symlinks(char *path) ...@@ -358,7 +356,7 @@ resolve_symlinks(char *path)
if (chdir(orig_wd) == -1) if (chdir(orig_wd) == -1)
{ {
log_error(_("could not change directory to \"%s\""), orig_wd); log_error(gettext("could not change directory to \"%s\""), orig_wd);
return -1; return -1;
} }
...@@ -568,13 +566,13 @@ pclose_check(FILE *stream) ...@@ -568,13 +566,13 @@ pclose_check(FILE *stream)
perror("pclose failed"); perror("pclose failed");
} }
else if (WIFEXITED(exitstatus)) else if (WIFEXITED(exitstatus))
log_error(_("child process exited with exit code %d"), log_error(gettext("child process exited with exit code %d"),
WEXITSTATUS(exitstatus)); WEXITSTATUS(exitstatus));
else if (WIFSIGNALED(exitstatus)) else if (WIFSIGNALED(exitstatus))
log_error(_("child process was terminated by signal %d"), log_error(gettext("child process was terminated by signal %d"),
WTERMSIG(exitstatus)); WTERMSIG(exitstatus));
else else
log_error(_("child process exited with unrecognized status %d"), log_error(gettext("child process exited with unrecognized status %d"),
exitstatus); exitstatus);
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment