missing translation marker

Started by Alvaro Herreraalmost 17 years ago2 messageshackers
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

Hi,

It seems there's a missing gettext() call in new code in hba.c, per the
patch below. I don't actually like this, but it seems the alternative
would be to create a variadic function which I believe to be
overengineering ...

Index: hba.c
===================================================================
RCS file: /home/alvherre/Code/cvs/pgsql/src/backend/libpq/hba.c,v
retrieving revision 1.184
diff -c -p -u -r1.184 hba.c
cvs diff: conflicting specifications of output style
--- hba.c	25 Mar 2009 14:12:02 -0000	1.184
+++ hba.c	15 Apr 2009 16:50:21 -0000
@@ -579,7 +579,7 @@ check_db(const char *dbname, const char 
 	ereport(LOG, \
 			(errcode(ERRCODE_CONFIG_FILE_ERROR), \
 			 errmsg("authentication option \"%s\" is only valid for authentication methods \"%s\"", \
-					optname, validmethods), \
+					optname, _(validmethods)), \
 			 errcontext("line %d of configuration file \"%s\"", \
 					line_num, HbaFileName))); \
 	return false; \
@@ -952,7 +952,7 @@ parse_hba_line(List *line, int line_num,
 					parsedline->auth_method != uaGSS &&
 					parsedline->auth_method != uaSSPI &&
 					parsedline->auth_method != uaCert)
-					INVALID_AUTH_OPTION("map", "ident, krb5, gssapi, sspi and cert");
+					INVALID_AUTH_OPTION("map", gettext_noop("ident, krb5, gssapi, sspi and cert"));
 				parsedline->usermap = pstrdup(c);
 			}
 			else if (strcmp(token, "clientcert") == 0)
@@ -1050,7 +1050,7 @@ parse_hba_line(List *line, int line_num,
 				if (parsedline->auth_method != uaKrb5 &&
 					parsedline->auth_method != uaGSS &&
 					parsedline->auth_method != uaSSPI)
-					INVALID_AUTH_OPTION("krb_realm", "krb5, gssapi and sspi");
+					INVALID_AUTH_OPTION("krb_realm", gettext_noop("krb5, gssapi and sspi"));
 				parsedline->krb_realm = pstrdup(c);
 			}
 			else if (strcmp(token, "include_realm") == 0)
@@ -1058,7 +1058,7 @@ parse_hba_line(List *line, int line_num,
 				if (parsedline->auth_method != uaKrb5 &&
 					parsedline->auth_method != uaGSS &&
 					parsedline->auth_method != uaSSPI)
-					INVALID_AUTH_OPTION("include_realm", "krb5, gssapi and sspi");
+					INVALID_AUTH_OPTION("include_realm", gettext_noop("krb5, gssapi and sspi"));
 				if (strcmp(c, "1") == 0)
 					parsedline->include_realm = true;
 				else

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: missing translation marker

Alvaro Herrera <alvherre@commandprompt.com> writes:

It seems there's a missing gettext() call in new code in hba.c, per the
patch below. I don't actually like this, but it seems the alternative
would be to create a variadic function which I believe to be
overengineering ...

Hmm ... if the second %s here is meant to be a list of auth method
names:

ereport(LOG, \
(errcode(ERRCODE_CONFIG_FILE_ERROR), \
errmsg("authentication option \"%s\" is only valid for authentication methods \"%s\"", \
- optname, validmethods), \
+ optname, _(validmethods)), \
errcontext("line %d of configuration file \"%s\"", \
line_num, HbaFileName))); \

then I argue that putting double quotes around it is wrong, too.

It might be technically correct to quote the individual method names
within the list that's being passed in, but I wouldn't bother.

regards, tom lane