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

Commit0542b1e

Browse files
committed
Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
1 parent64011b4 commit0542b1e

File tree

43 files changed

+297
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+297
-304
lines changed

‎src/backend/catalog/dependency.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.41 2004/12/31 21:59:38 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.42 2005/02/22 04:35:34 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1424,18 +1424,18 @@ getObjectDescription(const ObjectAddress *object)
14241424
caseOCLASS_CLASS:
14251425
getRelationDescription(&buffer,object->objectId);
14261426
if (object->objectSubId!=0)
1427-
appendStringInfo(&buffer,gettext(" column %s"),
1427+
appendStringInfo(&buffer,_(" column %s"),
14281428
get_relid_attribute_name(object->objectId,
14291429
object->objectSubId));
14301430
break;
14311431

14321432
caseOCLASS_PROC:
1433-
appendStringInfo(&buffer,gettext("function %s"),
1433+
appendStringInfo(&buffer,_("function %s"),
14341434
format_procedure(object->objectId));
14351435
break;
14361436

14371437
caseOCLASS_TYPE:
1438-
appendStringInfo(&buffer,gettext("type %s"),
1438+
appendStringInfo(&buffer,_("type %s"),
14391439
format_type_be(object->objectId));
14401440
break;
14411441

@@ -1465,7 +1465,7 @@ getObjectDescription(const ObjectAddress *object)
14651465

14661466
castForm= (Form_pg_cast)GETSTRUCT(tup);
14671467

1468-
appendStringInfo(&buffer,gettext("cast from %s to %s"),
1468+
appendStringInfo(&buffer,_("cast from %s to %s"),
14691469
format_type_be(castForm->castsource),
14701470
format_type_be(castForm->casttarget));
14711471

@@ -1502,13 +1502,13 @@ getObjectDescription(const ObjectAddress *object)
15021502

15031503
if (OidIsValid(con->conrelid))
15041504
{
1505-
appendStringInfo(&buffer,gettext("constraint %s on "),
1505+
appendStringInfo(&buffer,_("constraint %s on "),
15061506
NameStr(con->conname));
15071507
getRelationDescription(&buffer,con->conrelid);
15081508
}
15091509
else
15101510
{
1511-
appendStringInfo(&buffer,gettext("constraint %s"),
1511+
appendStringInfo(&buffer,_("constraint %s"),
15121512
NameStr(con->conname));
15131513
}
15141514

@@ -1527,7 +1527,7 @@ getObjectDescription(const ObjectAddress *object)
15271527
if (!HeapTupleIsValid(conTup))
15281528
elog(ERROR,"cache lookup failed for conversion %u",
15291529
object->objectId);
1530-
appendStringInfo(&buffer,gettext("conversion %s"),
1530+
appendStringInfo(&buffer,_("conversion %s"),
15311531
NameStr(((Form_pg_conversion)GETSTRUCT(conTup))->conname));
15321532
ReleaseSysCache(conTup);
15331533
break;
@@ -1564,7 +1564,7 @@ getObjectDescription(const ObjectAddress *object)
15641564
colobject.objectId=attrdef->adrelid;
15651565
colobject.objectSubId=attrdef->adnum;
15661566

1567-
appendStringInfo(&buffer,gettext("default for %s"),
1567+
appendStringInfo(&buffer,_("default for %s"),
15681568
getObjectDescription(&colobject));
15691569

15701570
systable_endscan(adscan);
@@ -1582,14 +1582,14 @@ getObjectDescription(const ObjectAddress *object)
15821582
if (!HeapTupleIsValid(langTup))
15831583
elog(ERROR,"cache lookup failed for language %u",
15841584
object->objectId);
1585-
appendStringInfo(&buffer,gettext("language %s"),
1585+
appendStringInfo(&buffer,_("language %s"),
15861586
NameStr(((Form_pg_language)GETSTRUCT(langTup))->lanname));
15871587
ReleaseSysCache(langTup);
15881588
break;
15891589
}
15901590

15911591
caseOCLASS_OPERATOR:
1592-
appendStringInfo(&buffer,gettext("operator %s"),
1592+
appendStringInfo(&buffer,_("operator %s"),
15931593
format_operator(object->objectId));
15941594
break;
15951595

@@ -1623,7 +1623,7 @@ getObjectDescription(const ObjectAddress *object)
16231623
else
16241624
nspname=get_namespace_name(opcForm->opcnamespace);
16251625

1626-
appendStringInfo(&buffer,gettext("operator class %s for access method %s"),
1626+
appendStringInfo(&buffer,_("operator class %s for access method %s"),
16271627
quote_qualified_identifier(nspname,
16281628
NameStr(opcForm->opcname)),
16291629
NameStr(amForm->amname));
@@ -1659,7 +1659,7 @@ getObjectDescription(const ObjectAddress *object)
16591659

16601660
rule= (Form_pg_rewrite)GETSTRUCT(tup);
16611661

1662-
appendStringInfo(&buffer,gettext("rule %s on "),
1662+
appendStringInfo(&buffer,_("rule %s on "),
16631663
NameStr(rule->rulename));
16641664
getRelationDescription(&buffer,rule->ev_class);
16651665

@@ -1694,7 +1694,7 @@ getObjectDescription(const ObjectAddress *object)
16941694

16951695
trig= (Form_pg_trigger)GETSTRUCT(tup);
16961696

1697-
appendStringInfo(&buffer,gettext("trigger %s on "),
1697+
appendStringInfo(&buffer,_("trigger %s on "),
16981698
NameStr(trig->tgname));
16991699
getRelationDescription(&buffer,trig->tgrelid);
17001700

@@ -1711,7 +1711,7 @@ getObjectDescription(const ObjectAddress *object)
17111711
if (!nspname)
17121712
elog(ERROR,"cache lookup failed for namespace %u",
17131713
object->objectId);
1714-
appendStringInfo(&buffer,gettext("schema %s"),nspname);
1714+
appendStringInfo(&buffer,_("schema %s"),nspname);
17151715
break;
17161716
}
17171717

@@ -1755,40 +1755,40 @@ getRelationDescription(StringInfo buffer, Oid relid)
17551755
switch (relForm->relkind)
17561756
{
17571757
caseRELKIND_RELATION:
1758-
appendStringInfo(buffer,gettext("table %s"),
1758+
appendStringInfo(buffer,_("table %s"),
17591759
relname);
17601760
break;
17611761
caseRELKIND_INDEX:
1762-
appendStringInfo(buffer,gettext("index %s"),
1762+
appendStringInfo(buffer,_("index %s"),
17631763
relname);
17641764
break;
17651765
caseRELKIND_SPECIAL:
1766-
appendStringInfo(buffer,gettext("special system relation %s"),
1766+
appendStringInfo(buffer,_("special system relation %s"),
17671767
relname);
17681768
break;
17691769
caseRELKIND_SEQUENCE:
1770-
appendStringInfo(buffer,gettext("sequence %s"),
1770+
appendStringInfo(buffer,_("sequence %s"),
17711771
relname);
17721772
break;
17731773
caseRELKIND_UNCATALOGED:
1774-
appendStringInfo(buffer,gettext("uncataloged table %s"),
1774+
appendStringInfo(buffer,_("uncataloged table %s"),
17751775
relname);
17761776
break;
17771777
caseRELKIND_TOASTVALUE:
1778-
appendStringInfo(buffer,gettext("toast table %s"),
1778+
appendStringInfo(buffer,_("toast table %s"),
17791779
relname);
17801780
break;
17811781
caseRELKIND_VIEW:
1782-
appendStringInfo(buffer,gettext("view %s"),
1782+
appendStringInfo(buffer,_("view %s"),
17831783
relname);
17841784
break;
17851785
caseRELKIND_COMPOSITE_TYPE:
1786-
appendStringInfo(buffer,gettext("composite type %s"),
1786+
appendStringInfo(buffer,_("composite type %s"),
17871787
relname);
17881788
break;
17891789
default:
17901790
/* shouldn't get here */
1791-
appendStringInfo(buffer,gettext("relation %s"),
1791+
appendStringInfo(buffer,_("relation %s"),
17921792
relname);
17931793
break;
17941794
}

‎src/backend/libpq/auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.122 2005/01/12 21:37:53 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.123 2005/02/22 04:35:57 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -449,7 +449,7 @@ ClientAuthentication(Port *port)
449449
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
450450
errmsg("no pg_hba.conf entry for host \"%s\", user \"%s\", database \"%s\", %s",
451451
hostinfo,port->user_name,port->database_name,
452-
port->ssl ?gettext("SSL on") :gettext("SSL off"))));
452+
port->ssl ?_("SSL on") :_("SSL off"))));
453453
#else
454454
ereport(FATAL,
455455
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),

‎src/backend/libpq/pqcomm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
3131
* Portions Copyright (c) 1994, Regents of the University of California
3232
*
33-
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.175 2005/01/12 16:38:17 tgl Exp $
33+
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.176 2005/02/22 04:35:57 momjian Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -308,21 +308,21 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
308308
switch (addr->ai_family)
309309
{
310310
caseAF_INET:
311-
familyDesc=gettext("IPv4");
311+
familyDesc=_("IPv4");
312312
break;
313313
#ifdefHAVE_IPV6
314314
caseAF_INET6:
315-
familyDesc=gettext("IPv6");
315+
familyDesc=_("IPv6");
316316
break;
317317
#endif
318318
#ifdefHAVE_UNIX_SOCKETS
319319
caseAF_UNIX:
320-
familyDesc=gettext("Unix");
320+
familyDesc=_("Unix");
321321
break;
322322
#endif
323323
default:
324324
snprintf(familyDescBuf,sizeof(familyDescBuf),
325-
gettext("unrecognized address family %d"),
325+
_("unrecognized address family %d"),
326326
addr->ai_family);
327327
familyDesc=familyDescBuf;
328328
break;

‎src/backend/parser/scan.l

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.119 2004/12/31 22:00:27 pgsql Exp $
13+
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.120 2005/02/22 04:36:22 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -618,15 +618,15 @@ yyerror(const char *message)
618618
ereport(ERROR,
619619
(errcode(ERRCODE_SYNTAX_ERROR),
620620
/* translator: %s is typically "syntax error" */
621-
errmsg("%s at end of input",gettext(message)),
621+
errmsg("%s at end of input",_(message)),
622622
errposition(cursorpos)));
623623
}
624624
else
625625
{
626626
ereport(ERROR,
627627
(errcode(ERRCODE_SYNTAX_ERROR),
628628
/* translator: first %s is typically "syntax error" */
629-
errmsg("%s at or near\"%s\"",gettext(message), loc),
629+
errmsg("%s at or near\"%s\"",_(message), loc),
630630
errposition(cursorpos)));
631631
}
632632
}

‎src/backend/postmaster/postmaster.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.444 2005/02/20 02:21:54 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.445 2005/02/22 04:36:36 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -1065,35 +1065,35 @@ pmdaemonize(void)
10651065
staticvoid
10661066
usage(constchar*progname)
10671067
{
1068-
printf(gettext("%s is the PostgreSQL server.\n\n"),progname);
1069-
printf(gettext("Usage:\n %s [OPTION]...\n\n"),progname);
1070-
printf(gettext("Options:\n"));
1068+
printf(_("%s is the PostgreSQL server.\n\n"),progname);
1069+
printf(_("Usage:\n %s [OPTION]...\n\n"),progname);
1070+
printf(_("Options:\n"));
10711071
#ifdefUSE_ASSERT_CHECKING
1072-
printf(gettext(" -A 1|0 enable/disable run-time assert checking\n"));
1072+
printf(_(" -A 1|0 enable/disable run-time assert checking\n"));
10731073
#endif
1074-
printf(gettext(" -B NBUFFERS number of shared buffers\n"));
1075-
printf(gettext(" -c NAME=VALUE set run-time parameter\n"));
1076-
printf(gettext(" -d 1-5 debugging level\n"));
1077-
printf(gettext(" -D DATADIR database directory\n"));
1078-
printf(gettext(" -F turn fsync off\n"));
1079-
printf(gettext(" -h HOSTNAME host name or IP address to listen on\n"));
1080-
printf(gettext(" -i enable TCP/IP connections\n"));
1081-
printf(gettext(" -k DIRECTORY Unix-domain socket location\n"));
1074+
printf(_(" -B NBUFFERS number of shared buffers\n"));
1075+
printf(_(" -c NAME=VALUE set run-time parameter\n"));
1076+
printf(_(" -d 1-5 debugging level\n"));
1077+
printf(_(" -D DATADIR database directory\n"));
1078+
printf(_(" -F turn fsync off\n"));
1079+
printf(_(" -h HOSTNAME host name or IP address to listen on\n"));
1080+
printf(_(" -i enable TCP/IP connections\n"));
1081+
printf(_(" -k DIRECTORY Unix-domain socket location\n"));
10821082
#ifdefUSE_SSL
1083-
printf(gettext(" -l enable SSL connections\n"));
1083+
printf(_(" -l enable SSL connections\n"));
10841084
#endif
1085-
printf(gettext(" -N MAX-CONNECT maximum number of allowed connections\n"));
1086-
printf(gettext(" -o OPTIONS pass \"OPTIONS\" to each server process\n"));
1087-
printf(gettext(" -p PORT port number to listen on\n"));
1088-
printf(gettext(" -S silent mode (start in background without logging output)\n"));
1089-
printf(gettext(" --help show this help, then exit\n"));
1090-
printf(gettext(" --version output version information, then exit\n"));
1091-
1092-
printf(gettext("\nDeveloper options:\n"));
1093-
printf(gettext(" -n do not reinitialize shared memory after abnormal exit\n"));
1094-
printf(gettext(" -s send SIGSTOP to all backend servers if one dies\n"));
1095-
1096-
printf(gettext("\nPlease read the documentation for the complete list of run-time\n"
1085+
printf(_(" -N MAX-CONNECT maximum number of allowed connections\n"));
1086+
printf(_(" -o OPTIONS pass \"OPTIONS\" to each server process\n"));
1087+
printf(_(" -p PORT port number to listen on\n"));
1088+
printf(_(" -S silent mode (start in background without logging output)\n"));
1089+
printf(_(" --help show this help, then exit\n"));
1090+
printf(_(" --version output version information, then exit\n"));
1091+
1092+
printf(_("\nDeveloper options:\n"));
1093+
printf(_(" -n do not reinitialize shared memory after abnormal exit\n"));
1094+
printf(_(" -s send SIGSTOP to all backend servers if one dies\n"));
1095+
1096+
printf(_("\nPlease read the documentation for the complete list of run-time\n"
10971097
"configuration settings and how to set them on the command line or in\n"
10981098
"the configuration file.\n\n"
10991099
"Report bugs to <pgsql-bugs@postgresql.org>.\n"));
@@ -1993,7 +1993,7 @@ reaper(SIGNAL_ARGS)
19931993
StartupPID=0;
19941994
if (exitstatus!=0)
19951995
{
1996-
LogChildExit(LOG,gettext("startup process"),
1996+
LogChildExit(LOG,_("startup process"),
19971997
pid,exitstatus);
19981998
ereport(LOG,
19991999
(errmsg("aborting startup due to startup process failure")));
@@ -2067,7 +2067,7 @@ reaper(SIGNAL_ARGS)
20672067
* Any unexpected exit of the bgwriter is treated as a crash.
20682068
*/
20692069
HandleChildCrash(pid,exitstatus,
2070-
gettext("background writer process"));
2070+
_("background writer process"));
20712071
continue;
20722072
}
20732073

@@ -2080,7 +2080,7 @@ reaper(SIGNAL_ARGS)
20802080
{
20812081
PgArchPID=0;
20822082
if (exitstatus!=0)
2083-
LogChildExit(LOG,gettext("archiver process"),
2083+
LogChildExit(LOG,_("archiver process"),
20842084
pid,exitstatus);
20852085
if (XLogArchivingActive()&&
20862086
StartupPID==0&& !FatalError&&Shutdown==NoShutdown)
@@ -2097,7 +2097,7 @@ reaper(SIGNAL_ARGS)
20972097
{
20982098
PgStatPID=0;
20992099
if (exitstatus!=0)
2100-
LogChildExit(LOG,gettext("statistics collector process"),
2100+
LogChildExit(LOG,_("statistics collector process"),
21012101
pid,exitstatus);
21022102
if (StartupPID==0&& !FatalError&&Shutdown==NoShutdown)
21032103
PgStatPID=pgstat_start();
@@ -2111,7 +2111,7 @@ reaper(SIGNAL_ARGS)
21112111
/* for safety's sake, launch new logger *first* */
21122112
SysLoggerPID=SysLogger_Start();
21132113
if (exitstatus!=0)
2114-
LogChildExit(LOG,gettext("system logger process"),
2114+
LogChildExit(LOG,_("system logger process"),
21152115
pid,exitstatus);
21162116
continue;
21172117
}
@@ -2178,7 +2178,7 @@ CleanupBackend(int pid,
21782178
{
21792179
Dlelem*curr;
21802180

2181-
LogChildExit(DEBUG2,gettext("server process"),pid,exitstatus);
2181+
LogChildExit(DEBUG2,_("server process"),pid,exitstatus);
21822182

21832183
/*
21842184
* If a backend dies in an ugly way (i.e. exit status not 0) then we
@@ -2188,7 +2188,7 @@ CleanupBackend(int pid,
21882188
*/
21892189
if (exitstatus!=0)
21902190
{
2191-
HandleChildCrash(pid,exitstatus,gettext("server process"));
2191+
HandleChildCrash(pid,exitstatus,_("server process"));
21922192
return;
21932193
}
21942194

@@ -2512,7 +2512,7 @@ report_fork_failure_to_client(Port *port, int errnum)
25122512

25132513
/* Format the error message packet (always V2 protocol) */
25142514
snprintf(buffer,sizeof(buffer),"E%s%s\n",
2515-
gettext("could not fork new process for connection: "),
2515+
_("could not fork new process for connection: "),
25162516
strerror(errnum));
25172517

25182518
/* Set port to non-blocking. Don't do send() if this fails */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp