Ignore:
Timestamp:
Mar 4, 2008, 2:02:25 AM (14 years ago)
Author:
charles
Message:

first cut at adding i18n hooks into libtransmission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r5185 r5193  
    363363    if( stat( path, &sb ) )
    364364    {
    365         tr_err( "Couldn't get information for file \"%s\" %s", path, tr_strerror(errno) );
     365        tr_err( _( "Couldn't get information for file \"%s\": %s" ), path, tr_strerror(errno) );
    366366        return NULL;
    367367    }
     
    369369    if( ( sb.st_mode & S_IFMT ) != S_IFREG )
    370370    {
    371         tr_err( "Not a regular file (%s)", path );
     371        tr_err( _( "Not a regular file (%s)" ), path );
    372372        return NULL;
    373373    }
     
    377377    if( !file )
    378378    {
    379         tr_err( "Couldn't open file \"%s\" %s", path, tr_strerror(errno) );
     379        tr_err( _( "Couldn't open file \"%s\": %s" ), path, tr_strerror(errno) );
    380380        return NULL;
    381381    }
     
    383383    if( NULL == buf )
    384384    {
    385         tr_err( "Couldn't allocate memory (%"PRIu64" bytes)",
    386                 ( uint64_t )sb.st_size );
     385        tr_err( _( "Couldn't read file \"%s\": memory allocation failed" ) );
    387386        fclose( file );
     387        return NULL;
    388388    }
    389389    fseek( file, 0, SEEK_SET );
    390390    if( fread( buf, sb.st_size, 1, file ) != 1 )
    391391    {
    392         tr_err( "Error reading \"%s\" %s", path, tr_strerror(errno) );
     392        tr_err( _( "Couldn't read file \"%s\": %s" ), path, tr_strerror(errno) );
    393393        free( buf );
    394394        fclose( file );
     
    445445            if( tr_mkdir( path, permissions ) ) {
    446446                const int err = errno;
    447                 tr_err( "Couldn't create directory %s (%s)", path, tr_strerror( err ) );
     447                tr_err( _( "Couldn't create \"%s\": %s" ), path, tr_strerror( err ) );
    448448                tr_free( path );
    449449                errno = err;
     
    454454        {
    455455            /* Node exists but isn't a folder */
    456             tr_err( "Remove %s, it's in the way.", path );
     456            tr_err( _( "Remove \"%s\", it's in the way." ), path );
    457457            tr_free( path );
    458458            errno = ENOTDIR;
     
    520520    {
    521521        case TR_OK:
    522             return "No error";
     522            return _( "No error" );
    523523
    524524        case TR_ERROR:
    525             return "Generic error";
     525            return _( "Generic error" );
    526526        case TR_ERROR_ASSERT:
    527             return "Assert error";
     527            return _( "Assert error" );
    528528
    529529        case TR_ERROR_IO_PARENT:
    530             return "Download folder does not exist";
     530            return _( "Download folder does not exist" );
    531531        case TR_ERROR_IO_PERMISSIONS:
    532             return "Insufficient permissions";
     532            return _( "Insufficient permissions" );
    533533        case TR_ERROR_IO_SPACE:
    534             return "Insufficient free space";
     534            return _( "Insufficient free space" );
    535535        case TR_ERROR_IO_FILE_TOO_BIG:
    536             return "File too large";
     536            return _( "File too large" );
    537537        case TR_ERROR_IO_OPEN_FILES:
    538             return "Too many open files";
     538            return _( "Too many open files" );
    539539        case TR_ERROR_IO_DUP_DOWNLOAD:
    540             return "Already active transfer with same name and download folder";
     540            return _( "Already active transfer with same name and download folder" );
    541541        case TR_ERROR_IO_OTHER:
    542             return "Generic I/O error";
     542            return _( "Generic I/O error" );
    543543
    544544        case TR_ERROR_TC_ERROR:
    545             return "Tracker error";
     545            return _( "Tracker error" );
    546546        case TR_ERROR_TC_WARNING:
    547             return "Tracker warning";
     547            return _( "Tracker warning" );
    548548
    549549        case TR_ERROR_PEER_MESSAGE:
    550             return "Peer sent a bad message";
     550            return _( "Peer sent a bad message" );
    551551
    552552        default:
    553             return "Unknown error";
     553            return _( "Unknown error" );
    554554    }
    555555}
Note: See TracChangeset for help on using the changeset viewer.