Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99b735c

Browse files
committed
Work around lack of NLS support in libpgport by making those components
who use it scan the relevant source files for their own catalog. Itcreates a bit of duplicate work for translators, but it gets the job donefor now.
1 parenta420b76 commit99b735c

File tree

8 files changed

+28
-30
lines changed

8 files changed

+28
-30
lines changed

‎src/backend/nls.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/backend/nls.mk,v 1.15 2004/08/11 09:00:27 petere Exp $
1+
# $PostgreSQL: pgsql/src/backend/nls.mk,v 1.16 2004/11/27 22:44:10 petere Exp $
22
CATALOG_NAME:= postgres
33
AVAIL_LANGUAGES:= af cs de es fr hr hu it nb pt_BR ru sk sv tr zh_CN zh_TW
44
GETTEXT_FILES:= + gettext-files
@@ -7,7 +7,7 @@ GETTEXT_FILES:= + gettext-files
77
GETTEXT_TRIGGERS:= errmsg errdetail errhint errcontext write_stderr yyerror
88

99
gettext-files: distprep
10-
find$(srcdir)/ -name'*.c' -print>$@
10+
find$(srcdir)/$(srcdir)/../port/-name'*.c' -print>$@
1111

1212
my-maintainer-clean:
1313
rm -f gettext-files

‎src/bin/initdb/nls.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# $PostgreSQL: pgsql/src/bin/initdb/nls.mk,v 1.15 2004/11/16 22:43:48 petere Exp $
1+
# $PostgreSQL: pgsql/src/bin/initdb/nls.mk,v 1.16 2004/11/27 22:44:11 petere Exp $
22
CATALOG_NAME:= initdb
33
AVAIL_LANGUAGES:= cs de es fr it pt_BR ro ru sk sl sv tr zh_CN zh_TW
4-
GETTEXT_FILES:= initdb.c
4+
GETTEXT_FILES:= initdb.c ../../port/dirmod.c ../../port/exec.c
55
GETTEXT_TRIGGERS:= _ simple_prompt

‎src/bin/pg_config/nls.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# $PostgreSQL: pgsql/src/bin/pg_config/nls.mk,v 1.11 2004/11/23 23:13:07 petere Exp $
1+
# $PostgreSQL: pgsql/src/bin/pg_config/nls.mk,v 1.12 2004/11/27 22:44:12 petere Exp $
22
CATALOG_NAME:= pg_config
33
AVAIL_LANGUAGES:= cs de es fr pt_BR ro ru sl sv tr zh_TW
4-
GETTEXT_FILES:= pg_config.c
4+
GETTEXT_FILES:= pg_config.c ../../port/exec.c
55
GETTEXT_TRIGGERS:= _

‎src/bin/pg_ctl/nls.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# $PostgreSQL: pgsql/src/bin/pg_ctl/nls.mk,v 1.13 2004/11/23 23:13:18 petere Exp $
1+
# $PostgreSQL: pgsql/src/bin/pg_ctl/nls.mk,v 1.14 2004/11/27 22:44:13 petere Exp $
22
CATALOG_NAME:= pg_ctl
33
AVAIL_LANGUAGES:= cs de es fr pt_BR ro ru sk sl sv tr zh_CN zh_TW
4-
GETTEXT_FILES:= pg_ctl.c
4+
GETTEXT_FILES:= pg_ctl.c ../../port/exec.c
55
GETTEXT_TRIGGERS:= _ simple_prompt

‎src/bin/pg_dump/nls.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# $PostgreSQL: pgsql/src/bin/pg_dump/nls.mk,v 1.17 2004/11/18 10:09:58 petere Exp $
1+
# $PostgreSQL: pgsql/src/bin/pg_dump/nls.mk,v 1.18 2004/11/27 22:44:13 petere Exp $
22
CATALOG_NAME:= pg_dump
33
AVAIL_LANGUAGES:= cs de es fr it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW
44
GETTEXT_FILES:= pg_dump.c common.c pg_backup_archiver.c pg_backup_custom.c\
55
pg_backup_db.c pg_backup_files.c pg_backup_null.c\
6-
pg_backup_tar.c pg_restore.c pg_dumpall.c
6+
pg_backup_tar.c pg_restore.c pg_dumpall.c\
7+
../../port/exec.c
78
GETTEXT_TRIGGERS:= write_msg:2 die_horribly:3 exit_horribly:3 simple_prompt\
89
ExecuteSqlCommand:3 ahlog:3 _

‎src/bin/psql/nls.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# $PostgreSQL: pgsql/src/bin/psql/nls.mk,v 1.19 2004/11/07 23:38:15 petere Exp $
1+
# $PostgreSQL: pgsql/src/bin/psql/nls.mk,v 1.20 2004/11/27 22:44:14 petere Exp $
22
CATALOG_NAME:= psql
33
AVAIL_LANGUAGES:= cs de es fa fr hu it nb pt_BR ro ru sk sl sv tr zh_CN zh_TW
44
GETTEXT_FILES:= command.c common.c copy.c help.c input.c large_obj.c\
5-
mainloop.c print.c startup.c describe.c sql_help.h
5+
mainloop.c print.c startup.c describe.c sql_help.h\
6+
../../port/exec.c
67
GETTEXT_TRIGGERS:= _ N_ psql_error simple_prompt

‎src/port/dirmod.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*Win32 (NT, Win2k, XP).replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.32 2004/10/28 22:09:31 tgl Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.33 2004/11/27 22:44:15 petere Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -40,8 +40,6 @@
4040
#endif
4141
#endif
4242

43-
#define_(x) gettext((x))
44-
4543
#ifndefFRONTEND
4644

4745
/*
@@ -74,7 +72,7 @@ fe_palloc(Size size)
7472

7573
if ((res=malloc(size))==NULL)
7674
{
77-
fprintf(stderr,_("out of memory\n"));
75+
fprintf(stderr,gettext("out of memory\n"));
7876
exit(1);
7977
}
8078
returnres;
@@ -87,7 +85,7 @@ fe_pstrdup(const char *string)
8785

8886
if ((res=strdup(string))==NULL)
8987
{
90-
fprintf(stderr,_("out of memory\n"));
88+
fprintf(stderr,gettext("out of memory\n"));
9189
exit(1);
9290
}
9391
returnres;
@@ -100,7 +98,7 @@ fe_repalloc(void *pointer, Size size)
10098

10199
if ((res=realloc(pointer,size))==NULL)
102100
{
103-
fprintf(stderr,_("out of memory\n"));
101+
fprintf(stderr,gettext("out of memory\n"));
104102
exit(1);
105103
}
106104
returnres;

‎src/port/exec.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.32 2004/11/06 23:06:29 tgl Exp $
12+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.33 2004/11/27 22:44:15 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -28,8 +28,6 @@
2828
#include<unistd.h>
2929
#endif
3030

31-
#define_(x) gettext(x)
32-
3331
#ifndefS_IRUSR/* XXX [TRH] should be in a header */
3432
#defineS_IRUSR S_IREAD
3533
#defineS_IWUSR S_IWRITE
@@ -192,7 +190,7 @@ find_my_exec(const char *argv0, char *retpath)
192190

193191
if (!getcwd(cwd,MAXPGPATH))
194192
{
195-
log_error(_("could not identify current directory: %s"),
193+
log_error(gettext("could not identify current directory: %s"),
196194
strerror(errno));
197195
return-1;
198196
}
@@ -306,7 +304,7 @@ resolve_symlinks(char *path)
306304
*/
307305
if (!getcwd(orig_wd,MAXPGPATH))
308306
{
309-
log_error(_("could not identify current directory: %s"),
307+
log_error(gettext("could not identify current directory: %s"),
310308
strerror(errno));
311309
return-1;
312310
}
@@ -322,7 +320,7 @@ resolve_symlinks(char *path)
322320
*lsep='\0';
323321
if (chdir(path)==-1)
324322
{
325-
log_error(_("could not change directory to \"%s\""),path);
323+
log_error(gettext("could not change directory to \"%s\""),path);
326324
return-1;
327325
}
328326
fname=lsep+1;
@@ -337,7 +335,7 @@ resolve_symlinks(char *path)
337335
rllen=readlink(fname,link_buf,sizeof(link_buf));
338336
if (rllen<0||rllen >=sizeof(link_buf))
339337
{
340-
log_error(_("could not read symbolic link \"%s\""),fname);
338+
log_error(gettext("could not read symbolic link \"%s\""),fname);
341339
return-1;
342340
}
343341
link_buf[rllen]='\0';
@@ -349,7 +347,7 @@ resolve_symlinks(char *path)
349347

350348
if (!getcwd(path,MAXPGPATH))
351349
{
352-
log_error(_("could not identify current directory: %s"),
350+
log_error(gettext("could not identify current directory: %s"),
353351
strerror(errno));
354352
return-1;
355353
}
@@ -358,7 +356,7 @@ resolve_symlinks(char *path)
358356

359357
if (chdir(orig_wd)==-1)
360358
{
361-
log_error(_("could not change directory to \"%s\""),orig_wd);
359+
log_error(gettext("could not change directory to \"%s\""),orig_wd);
362360
return-1;
363361
}
364362

@@ -568,13 +566,13 @@ pclose_check(FILE *stream)
568566
perror("pclose failed");
569567
}
570568
elseif (WIFEXITED(exitstatus))
571-
log_error(_("child process exited with exit code %d"),
569+
log_error(gettext("child process exited with exit code %d"),
572570
WEXITSTATUS(exitstatus));
573571
elseif (WIFSIGNALED(exitstatus))
574-
log_error(_("child process was terminated by signal %d"),
572+
log_error(gettext("child process was terminated by signal %d"),
575573
WTERMSIG(exitstatus));
576574
else
577-
log_error(_("child process exited with unrecognized status %d"),
575+
log_error(gettext("child process exited with unrecognized status %d"),
578576
exitstatus);
579577

580578
return-1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp