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

Commit72be8c2

Browse files
committed
Fix set of NLS translation issues
While monitoring the code, a couple of issues related to stringtranslation has showed up:- Some routines for auto-updatable views return an error string, whichsometimes missed the shot. A comment regarding string translation isadded for each routine to help with future features.- GSSAPI authentication missed two translations.- vacuumdb handles non-translated strings.- GetConfigOptionByNum should translate strings. This part is notback-patched as after a minor upgrade this could be surprising forusers.Reported-by: Kyotaro HoriguchiAuthor: Kyotaro HoriguchiReviewed-by: Michael Paquier, Tom LaneDiscussion:https://postgr.es/m/20180810.152131.31921918.horiguchi.kyotaro@lab.ntt.co.jpBackpatch-through: 9.3
1 parentd8c8380 commit72be8c2

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10826,7 +10826,7 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
1082610826
ereport(ERROR,
1082710827
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1082810828
errmsg("WITH CHECK OPTION is supported only on automatically updatable views"),
10829-
errhint("%s",view_updatable_error)));
10829+
errhint("%s",_(view_updatable_error))));
1083010830
}
1083110831
}
1083210832

‎src/backend/commands/view.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ DefineView(ViewStmt *stmt, const char *queryString,
502502
ereport(ERROR,
503503
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
504504
errmsg("WITH CHECK OPTION is supported only on automatically updatable views"),
505-
errhint("%s",view_updatable_error)));
505+
errhint("%s",_(view_updatable_error))));
506506
}
507507

508508
/*

‎src/backend/libpq/auth.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,10 @@ static GSS_DLLIMP gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_desc;
10371037
#endif
10381038

10391039

1040+
/*
1041+
* Generate an error for GSSAPI authentication. The caller should apply
1042+
* _() to errmsg to make it translatable.
1043+
*/
10401044
staticvoid
10411045
pg_GSS_error(intseverity,constchar*errmsg,OM_uint32maj_stat,OM_uint32min_stat)
10421046
{
@@ -1227,7 +1231,7 @@ pg_GSS_recvauth(Port *port)
12271231
{
12281232
gss_delete_sec_context(&lmin_s,&port->gss->ctx,GSS_C_NO_BUFFER);
12291233
pg_GSS_error(ERROR,
1230-
gettext_noop("accepting GSS security context failed"),
1234+
_("accepting GSS security context failed"),
12311235
maj_stat,min_stat);
12321236
}
12331237

@@ -1253,7 +1257,7 @@ pg_GSS_recvauth(Port *port)
12531257
maj_stat=gss_display_name(&min_stat,port->gss->name,&gbuf,NULL);
12541258
if (maj_stat!=GSS_S_COMPLETE)
12551259
pg_GSS_error(ERROR,
1256-
gettext_noop("retrieving GSS user name failed"),
1260+
_("retrieving GSS user name failed"),
12571261
maj_stat,min_stat);
12581262

12591263
/*
@@ -1317,6 +1321,11 @@ pg_GSS_recvauth(Port *port)
13171321
*----------------------------------------------------------------
13181322
*/
13191323
#ifdefENABLE_SSPI
1324+
1325+
/*
1326+
* Generate an error for SSPI authentication. The caller should apply
1327+
* _() to errmsg to make it translatable.
1328+
*/
13201329
staticvoid
13211330
pg_SSPI_error(intseverity,constchar*errmsg,SECURITY_STATUSr)
13221331
{

‎src/backend/rewrite/rewriteHandler.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,9 @@ view_has_instead_trigger(Relation view, CmdType event)
22172217
* is auto-updatable. Returns NULL (if the column can be updated) or a message
22182218
* string giving the reason that it cannot be.
22192219
*
2220+
* The returned string has not been translated; if it is shown as an error
2221+
* message, the caller should apply _() to translate it.
2222+
*
22202223
* Note that the checks performed here are local to this view. We do not check
22212224
* whether the referenced column of the underlying base relation is updatable.
22222225
*/
@@ -2256,6 +2259,9 @@ view_col_is_auto_updatable(RangeTblRef *rtr, TargetEntry *tle)
22562259
* view_query_is_auto_updatable - test whether the specified view definition
22572260
* represents an auto-updatable view. Returns NULL (if the view can be updated)
22582261
* or a message string giving the reason that it cannot be.
2262+
2263+
* The returned string has not been translated; if it is shown as an error
2264+
* message, the caller should apply _() to translate it.
22592265
*
22602266
* If check_cols is true, the view is required to have at least one updatable
22612267
* column (necessary for INSERT/UPDATE). Otherwise the view's columns are not
@@ -2396,6 +2402,9 @@ view_query_is_auto_updatable(Query *viewquery, bool check_cols)
23962402
* required columns can be updated) or a message string giving the reason that
23972403
* they cannot be.
23982404
*
2405+
* The returned string has not been translated; if it is shown as an error
2406+
* message, the caller should apply _() to translate it.
2407+
*
23992408
* This should be used for INSERT/UPDATE to ensure that we don't attempt to
24002409
* assign to any non-updatable columns.
24012410
*

‎src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8454,13 +8454,13 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
84548454
values[2]=NULL;
84558455

84568456
/* group */
8457-
values[3]=config_group_names[conf->group];
8457+
values[3]=_(config_group_names[conf->group]);
84588458

84598459
/* short_desc */
8460-
values[4]=conf->short_desc;
8460+
values[4]=_(conf->short_desc);
84618461

84628462
/* extra_desc */
8463-
values[5]=conf->long_desc;
8463+
values[5]=_(conf->long_desc);
84648464

84658465
/* context */
84668466
values[6]=GucContext_Names[conf->context];

‎src/bin/scripts/vacuumdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
371371
{
372372
if (stage!=ANALYZE_NO_STAGE)
373373
printf(_("%s: processing database \"%s\": %s\n"),
374-
progname,PQdb(conn),stage_messages[stage]);
374+
progname,PQdb(conn),_(stage_messages[stage]));
375375
else
376376
printf(_("%s: vacuuming database \"%s\"\n"),
377377
progname,PQdb(conn));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp