1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(trunk gtk) #3555 "disambiguate the string 'None' for better i18n" -- fixed

This commit is contained in:
Charles Kerr 2010-09-16 17:45:24 +00:00
parent 1fbe8364bf
commit 2d1348c2f7
2 changed files with 24 additions and 24 deletions

View file

@ -617,8 +617,8 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
{
int i;
const char * str;
const char * none = _( "None" );
const char * mixed = _( "Mixed" );
const char * no_torrent = _( "No Torrents Selected" );
const char * stateString;
char buf[512];
uint64_t available = 0;
@ -632,7 +632,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* privacy_lb */
if( n<=0 )
str = none;
str = no_torrent;
else {
const tr_bool baseline = infos[0]->isPrivate;
for( i=1; i<n; ++i )
@ -650,7 +650,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* origin_lb */
if( n<=0 )
str = none;
str = no_torrent;
else {
const char * creator = infos[0]->creator ? infos[0]->creator : "";
const time_t date = infos[0]->dateCreated;
@ -696,7 +696,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* destination_lb */
if( n<=0 )
str = none;
str = no_torrent;
else {
const char * baseline = tr_torrentGetDownloadDir( torrents[0] );
for( i=1; i<n; ++i )
@ -710,8 +710,8 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
gtr_label_set_text( GTK_LABEL( di->destination_lb ), str );
/* state_lb */
if( n < 1 )
str = none;
if( n<=0 )
str = no_torrent;
else {
const tr_torrent_activity activity = stats[0]->activity;
tr_bool allFinished = stats[0]->finished;
@ -728,8 +728,8 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* date started */
if( n < 1 )
str = none;
if( n<=0 )
str = no_torrent;
else {
const time_t baseline = stats[0]->startDate;
for( i=1; i<n; ++i )
@ -746,8 +746,8 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* eta */
if( n <= 0 )
str = none;
if( n<=0 )
str = no_torrent;
else {
const int baseline = stats[0]->eta;
for( i=1; i<n; ++i )
@ -779,7 +779,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
}
tr_strlsize( sizebuf, size, sizeof( sizebuf ) );
if( !size )
str = none;
str = "";
else if( pieceSize >= 0 ) {
char piecebuf[128];
tr_formatter_mem_B( piecebuf, pieceSize, sizeof( piecebuf ) );
@ -801,7 +801,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* have_lb */
if( n <= 0 )
str = none;
str = no_torrent;
else {
uint64_t leftUntilDone = 0;
uint64_t haveUnchecked = 0;
@ -818,7 +818,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
available += st->sizeWhenDone - st->leftUntilDone + st->desiredAvailable;
}
if( !haveValid && !haveUnchecked )
str = none;
str = "";
else {
char buf2[32], unver[64], total[64];
const double ratio = 100.0 * ( leftUntilDone ? ( haveValid + haveUnchecked ) / (double)sizeWhenDone : 1 );
@ -836,7 +836,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* availability_lb */
if( !sizeWhenDone )
str = none;
str = "";
else {
char buf2[32];
const double d = ( 100.0 * available ) / sizeWhenDone;
@ -848,7 +848,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* dl_lb */
if( n <= 0 )
str = none;
str = no_torrent;
else {
char dbuf[64], fbuf[64];
uint64_t d=0, f=0;
@ -869,7 +869,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* ul_lb */
if( n <= 0 )
str = none;
str = no_torrent;
else {
uint64_t sum = 0;
for( i=0; i<n; ++i ) sum += stats[i]->uploadedEver;
@ -880,7 +880,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* ratio */
if( n <= 0 )
str = none;
str = no_torrent;
else {
uint64_t up = 0;
uint64_t down = 0;
@ -893,8 +893,8 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
gtr_label_set_text( GTK_LABEL( di->ratio_lb ), str );
/* hash_lb */
if( n<=0 )
str = none;
if( n <= 0 )
str = no_torrent;
else if ( n==1 )
str = infos[0]->hashString;
else
@ -903,7 +903,7 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
/* error */
if( n <= 0 )
str = none;
str = no_torrent;
else {
const char * baseline = stats[0]->errorString;
for( i=1; i<n; ++i )
@ -915,20 +915,20 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
str = mixed;
}
if( !str || !*str )
str = none;
str = _( "No errors" );
gtr_label_set_text( GTK_LABEL( di->error_lb ), str );
/* activity date */
if( n <= 0 )
str = none;
str = no_torrent;
else {
time_t latest = 0;
for( i=0; i<n; ++i )
if( latest < stats[i]->activityDate )
latest = stats[i]->activityDate;
if( latest <= 0 )
str = none;
str = _( "Never" );
else {
const int period = time( NULL ) - latest;
if( period < 5 )

View file

@ -158,7 +158,7 @@ char*
tr_strlsize( char * buf, guint64 bytes, size_t buflen )
{
if( !bytes )
g_strlcpy( buf, _( "None" ), buflen );
g_strlcpy( buf, _( "size|None" ), buflen );
else
tr_formatter_size_B( buf, bytes, buflen );