From e41ca42de100e1b762d2f0047c3609bcfb1c96e2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 6 Apr 2003 06:19:13 +0000 Subject: [PATCH] mark a few translatable strings --- libraries/liblber/assert.c | 2 +- libraries/liblber/debug.c | 2 +- libraries/liblber/io.c | 4 ++-- libraries/libldap/schema.c | 30 ++++++++++++++--------------- libraries/libldap/util-int.c | 37 ++++++++++++++++++------------------ 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/libraries/liblber/assert.c b/libraries/liblber/assert.c index 0f420ac7fd..b87d417c24 100644 --- a/libraries/liblber/assert.c +++ b/libraries/liblber/assert.c @@ -27,7 +27,7 @@ void ber_pvt_assert( const char *file, int line, const char *test ) { fprintf(stderr, - "Assertion failed: %s, file %s, line %d\n", + _("Assertion failed: %s, file %s, line %d\n"), test, file, line); abort(); diff --git a/libraries/liblber/debug.c b/libraries/liblber/debug.c index 02f439d87d..ff844feb70 100644 --- a/libraries/liblber/debug.c +++ b/libraries/liblber/debug.c @@ -117,7 +117,7 @@ static int addSubsys( const char *subsys, int level ) subsys_num = lutil_mnem2subsys(subsys); if(subsys_num < 0) { - fprintf(stderr, "Unknown Subsystem name [ %s ] - Discarded\n", + fprintf(stderr, _("Unknown Subsystem name [ %s ] - Discarded\n"), subsys); fflush(stderr); return -1; diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 125f7e9508..4edfb3f9ad 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -597,11 +597,11 @@ ber_get_next( if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) { #ifdef NEW_LOGGING LDAP_LOG( BER, ERR, - "ber_get_next: sockbuf_max_incoming limit hit " + "ber_get_next: sockbuf_max_incoming exceeded " "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming, 0 ); #else ber_log_printf( LDAP_DEBUG_CONNS, ber->ber_debug, - "ber_get_next: sockbuf_max_incoming limit hit " + "ber_get_next: sockbuf_max_incoming exceeded " "(%ld > %ld)\n", ber->ber_len, sb->sb_max_incoming ); #endif errno = ERANGE; diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index 0ac55075bf..ace40a523f 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -3233,27 +3233,27 @@ ldap_str2nameform( LDAP_CONST char * s, } static char *const err2text[] = { - "Success", - "Out of memory", - "Unexpected token", - "Missing opening parenthesis", - "Missing closing parenthesis", - "Expecting digit", - "Expecting a name", - "Bad description", - "Bad superiors", - "Duplicate option", - "Unexpected end of data", - "Missing required field", - "Out of order field" + N_("Success"), + N_("Out of memory"), + N_("Unexpected token"), + N_("Missing opening parenthesis"), + N_("Missing closing parenthesis"), + N_("Expecting digit"), + N_("Expecting a name"), + N_("Bad description"), + N_("Bad superiors"), + N_("Duplicate option"), + N_("Unexpected end of data"), + N_("Missing required field"), + N_("Out of order field") }; char * ldap_scherr2str(int code) { if ( code < 0 || code >= (int)(sizeof(err2text)/sizeof(char *)) ) { - return "Unknown error"; + return _("Unknown error"); } else { - return err2text[code]; + return _(err2text[code]); } } diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c index 962db37b48..4254c5f733 100644 --- a/libraries/libldap/util-int.c +++ b/libraries/libldap/util-int.c @@ -191,16 +191,15 @@ static const char * hp_strerror( int err ) { switch (err) { - case HOST_NOT_FOUND: return "Host not found (authoritative)"; - case TRY_AGAIN: return "Host not found (server fail?)"; - case NO_RECOVERY: return "Non-recoverable failure"; - case NO_DATA: return "No data of requested type"; + case HOST_NOT_FOUND: return _("Host not found (authoritative)"); + case TRY_AGAIN: return _("Host not found (server fail?)"); + case NO_RECOVERY: return _("Non-recoverable failure"); + case NO_DATA: return _("No data of requested type"); #ifdef NETDB_INTERNAL case NETDB_INTERNAL: return STRERROR( errno ); #endif - default: break; } - return "Unknown resolver error"; + return _("Unknown resolver error"); } #endif @@ -547,20 +546,20 @@ char *ldap_pvt_gai_strerror (int code) { const char *msg; } values[] = { #ifdef EAI_ADDRFAMILY - { EAI_ADDRFAMILY, "Address family for hostname not supported" }, + { EAI_ADDRFAMILY, N_("Address family for hostname not supported") }, #endif - { EAI_AGAIN, "Temporary failure in name resolution" }, - { EAI_BADFLAGS, "Bad value for ai_flags" }, - { EAI_FAIL, "Non-recoverable failure in name resolution" }, - { EAI_FAMILY, "ai_family not supported" }, - { EAI_MEMORY, "Memory allocation failure" }, + { EAI_AGAIN, N_("Temporary failure in name resolution") }, + { EAI_BADFLAGS, N_("Bad value for ai_flags") }, + { EAI_FAIL, N_("Non-recoverable failure in name resolution") }, + { EAI_FAMILY, N_("ai_family not supported") }, + { EAI_MEMORY, N_("Memory allocation failure") }, #ifdef EAI_NODATA - { EAI_NODATA, "No address associated with hostname" }, + { EAI_NODATA, N_("No address associated with hostname") }, #endif - { EAI_NONAME, "Name or service not known" }, - { EAI_SERVICE, "Servname not supported for ai_socktype" }, - { EAI_SOCKTYPE, "ai_socktype not supported" }, - { EAI_SYSTEM, "System error" }, + { EAI_NONAME, N_("Name or service not known") }, + { EAI_SERVICE, N_("Servname not supported for ai_socktype") }, + { EAI_SOCKTYPE, N_("ai_socktype not supported") }, + { EAI_SYSTEM, N_("System error") }, { 0, NULL } }; @@ -568,10 +567,10 @@ char *ldap_pvt_gai_strerror (int code) { for ( i = 0; values[i].msg != NULL; i++ ) { if ( values[i].code == code ) { - return (char *) values[i].msg; + return (char *) _(values[i].msg); } } - return "Unknown error"; + return _("Unknown error"); } #endif -- 2.39.5