Re: [PATCHES] Strings not possible to translate

2004-07-29 Thread Peter Eisentraut
Am Sonntag, 27. Juni 2004 09:44 schrieb Dennis Bjorklund:
> On Sun, 27 Jun 2004, Dennis Bjorklund wrote:
> > Here is a trivial fix for some error messages that was not translated
> > before.  I've also gotten rid of some cut and paste of strings. That
> > doesn't always work (like in this case) when translating.
>
> And here is the patch also :-)

Then commit it already. :-)

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] Strings not possible to translate

2004-06-27 Thread Dennis Bjorklund
On Sun, 27 Jun 2004, Dennis Bjorklund wrote:

> Here is a trivial fix for some error messages that was not translated
> before.  I've also gotten rid of some cut and paste of strings. That
> doesn't always work (like in this case) when translating.

And here is the patch also :-)

-- 
/Dennis Björklund
Index: auth.c
===
RCS file: /cvsroot/pgsql-server/src/backend/libpq/auth.c,v
retrieving revision 1.114
diff -u -c -r1.114 auth.c
*** auth.c  20 Dec 2003 18:24:52 -  1.114
--- auth.c  27 Jun 2004 07:28:27 -
***
*** 345,351 
  static void
  auth_failed(Port *port, int status)
  {
!   const char *authmethod = "Unknown auth method:";
  
/*
 * If we failed due to EOF from client, just quit; there's no point in
--- 345,351 
  static void
  auth_failed(Port *port, int status)
  {
!   const char *errstr;
  
/*
 * If we failed due to EOF from client, just quit; there's no point in
***
*** 363,398 
switch (port->auth_method)
{
case uaReject:
!   authmethod = "Rejected host:";
break;
case uaKrb4:
!   authmethod = "Kerberos4";
break;
case uaKrb5:
!   authmethod = "Kerberos5";
break;
case uaTrust:
!   authmethod = "Trusted";
break;
case uaIdent:
!   authmethod = "IDENT";
break;
case uaMD5:
case uaCrypt:
case uaPassword:
!   authmethod = "Password";
break;
  #ifdef USE_PAM
case uaPAM:
!   authmethod = "PAM";
break;
  #endif   /* USE_PAM */
}
  
ereport(FATAL,
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
!errmsg("%s authentication failed for user \"%s\"",
!   authmethod, port->user_name)));
/* doesn't return */
  }
  
--- 363,400 
switch (port->auth_method)
{
case uaReject:
!   errstr = gettext("Rejected host: authentication failed for 
user \"%s\"");
break;
case uaKrb4:
!   errstr = gettext("Kerberos4 authentication failed for user 
\"%s\"");
break;
case uaKrb5:
!   errstr = gettext("Kerberos5 authentication failed for user 
\"%s\"");
break;
case uaTrust:
!   errstr = gettext("Trusted authentication failed for user 
\"%s\"");
break;
case uaIdent:
!   errstr = gettext("IDENT authentication failed for user 
\"%s\"");
break;
case uaMD5:
case uaCrypt:
case uaPassword:
!   errstr = gettext("Password authentication failed for user 
\"%s\"");
break;
  #ifdef USE_PAM
case uaPAM:
!   errstr = gettext("PAM authentication failed for user \"%s\"");
break;
  #endif   /* USE_PAM */
+   default :
+   errstr = gettext("Unknown auth method: authentication failed 
for user \"%s\"");
+   break;
}
  
ereport(FATAL,
(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
!errmsg(errstr, port->user_name)));
/* doesn't return */
  }
  

---(end of broadcast)---
TIP 8: explain analyze is your friend