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

View file

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