Ignore:
Timestamp:
Mar 7, 2008, 3:26:59 AM (14 years ago)
Author:
charles
Message:

more i18n work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/natpmp.c

    r5208 r5209  
    3232#define COMMAND_WAIT_SECS 8
    3333
     34static const char * getKey( void ) { return _( "Port Mapping (NAT-PMP)" ); }
     35
    3436typedef enum
    3537{
     
    6466{
    6567    if( ret==NATPMP_TRYAGAIN )
    66         tr_dbg( _( "Port Mapping (NAT-PMP): %s returned 'try again'" ), func );
     68        tr_dbg( _( "%s: %s returned 'try again'" ), getKey(), func );
    6769    else if( ret >= 0 )
    68         tr_dbg( _( "Port Mapping (NAT-PMP): %s returned success (%d)" ), func, ret );
     70        tr_dbg( _( "%s: %s returned success (%d)" ), getKey(), func, ret );
    6971    else
    70         tr_err( _( "Port Mapping (NAT-PMP): %s returned error %d, errno is %d (%s)" ), func, ret, errno, tr_strerror(errno) );
     72        tr_err( _( "%s: %s returned error %d, errno is %d (%s)" ), getKey(), func, ret, errno, tr_strerror(errno) );
    7173}
    7274
     
    108110setErrorState( struct tr_natpmp * nat )
    109111{
    110     tr_err( _( "Port Mapping (NAT-PMP): If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ) );
    111     tr_err( _( "Port Mapping (NAT-PMP): NAT-PMP port forwarding unsuccessful, trying UPnP next" ) );
     112    tr_err( _( "%s: If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ), getKey() );
     113    tr_err( _( "%s: NAT-PMP port forwarding unsuccessful, trying UPnP next" ), getKey() );
    112114    nat->state = TR_NATPMP_ERR;
    113115}
     
    135137        logVal( "readnatpmpresponseorretry", val );
    136138        if( val >= 0 ) {
    137             tr_inf( _( "Port Mapping (NAT-PMP): found public address %s" ), inet_ntoa( response.publicaddress.addr ) );
     139            tr_inf( _( "%s: found public address %s" ), getKey(), inet_ntoa( response.publicaddress.addr ) );
    138140            nat->state = TR_NATPMP_IDLE;
    139141        } else if( val != NATPMP_TRYAGAIN ) {
     
    162164        logVal( "readnatpmpresponseorretry", val );
    163165        if( val >= 0 ) {
    164             tr_inf( _( "Port Mapping (NAT-PMP): port %d has been unmapped." ), nat->port );
     166            tr_inf( _( "%s: port %d has been unmapped." ), getKey(), nat->port );
    165167            nat->state = TR_NATPMP_IDLE;
    166168            nat->port = -1;
     
    198200            nat->renewTime = time( NULL ) + LIFETIME_SECS;
    199201            nat->port = resp.newportmapping.privateport;
    200             tr_inf( _( "Port Mapping (NAT-PMP): port %d mapped successfully" ), nat->port );
     202            tr_inf( _( "%s: port %d mapped successfully" ), getKey(), nat->port );
    201203        } else if( val != NATPMP_TRYAGAIN ) {
    202204            setErrorState( nat );
Note: See TracChangeset for help on using the changeset viewer.