more string work before the freeze. (1) use %'d to get thousands' grouping in end-user strings (2) follow HiG capitalization, quotation guidelines (3) fold a few more strings

This commit is contained in:
Charles Kerr 2008-03-19 20:07:27 +00:00
parent 1268a06337
commit 531dd851ad
14 changed files with 51 additions and 43 deletions

View File

@ -668,13 +668,14 @@ info_page_new (tr_torrent * tor)
GtkTextBuffer * b;
const tr_info * info = tr_torrentInfo(tor);
hig_workarea_add_section_title (t, &row, _("Torrent Information"));
hig_workarea_add_section_title (t, &row, _("Details"));
tr_strlsize( sizeStr, info->pieceSize, sizeof(sizeStr) );
g_snprintf( buf, sizeof( buf ),
/* %1$s is number of pieces; %2$s is how big each piece is */
ngettext( "%1$d Piece @ %2$s",
"%1$d Pieces @ %2$s",
/* %1$'d is number of pieces
%2$s is how big each piece is */
ngettext( "%1$'d Piece @ %2$s",
"%1$'d Pieces @ %2$s",
info->pieceCount ),
info->pieceCount, sizeStr );
l = gtk_label_new (buf);
@ -1224,7 +1225,8 @@ torrent_inspector_new ( GtkWindow * parent, TrTorrent * gtor )
/* create the dialog */
tr_strlsize( sizeStr, info->totalSize, sizeof(sizeStr) );
/* %1$s is torrent name; %2$s its file size */
/* %1$s is torrent name
%2$s its file size */
g_snprintf( title, sizeof(title), _( "Details for %1$s (%2$s)" ), info->name, sizeStr );
d = gtk_dialog_new_with_buttons (title, parent, 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,

View File

@ -186,7 +186,7 @@ onSelectionChanged( GtkFileChooser *chooser, gpointer user_data )
filename = gtk_file_chooser_get_filename( chooser );
if( !filename )
*buf = '\0';
g_snprintf( buf, sizeof( buf ), _( "No files selected" ) );
else {
ui->builder = tr_metaInfoBuilderCreate( ui->handle, filename );
g_snprintf( buf, sizeof(buf), "%s.torrent (%d%%)", filename, 0 );
@ -204,9 +204,10 @@ onSelectionChanged( GtkFileChooser *chooser, gpointer user_data )
else {
tr_strlsize( sizeStr, totalSize, sizeof(sizeStr) );
g_snprintf( buf, sizeof( buf ),
/* %1$s is the torrent size, %2$s is its number of files */
ngettext( "<i>%1$s; %2$d File</i>",
"<i>%1$s; %2$d Files</i>", fileCount ),
/* %1$s is the torrent size
%2$'d is its number of files */
ngettext( "<i>%1$s; %2$'d File</i>",
"<i>%1$s; %2$'d Files</i>", fileCount ),
sizeStr, fileCount );
}
gtk_label_set_markup ( GTK_LABEL(ui->size_lb), buf );
@ -216,9 +217,10 @@ onSelectionChanged( GtkFileChooser *chooser, gpointer user_data )
else {
tr_strlsize( sizeStr, pieceSize, sizeof(sizeStr) );
g_snprintf( buf, sizeof( buf ),
/* %1$s is number of pieces; %2$s is how big each piece is */
ngettext( "<i>%1$d Piece @ %2$s</i>",
"<i>%1$d Pieces @ %2$s</i>",
/* %1$'s is number of pieces;
%2$s is how big each piece is */
ngettext( "<i>%1$'d Piece @ %2$s</i>",
"<i>%1$'d Pieces @ %2$s</i>",
pieceCount ),
pieceCount, sizeStr );
}

View File

@ -108,7 +108,7 @@ stats_dialog_create( GtkWindow * parent, TrCore * core )
hig_workarea_add_row( t, &row, _("Duration:"), l, NULL );
hig_workarea_add_section_divider( t, &row );
hig_workarea_add_section_title( t, &row, _("Total") );
l = ui->all_sessions_lb = gtk_label_new( _("Program started %d times") );
l = ui->all_sessions_lb = gtk_label_new( _("Started %'d time") );
hig_workarea_add_label_w( t, row++, l );
l = ui->all_up_lb = gtk_label_new( NULL );
hig_workarea_add_row( t, &row, _("Uploaded:"), l, NULL );

View File

@ -195,8 +195,8 @@ getStatusString( const tr_stat * torStat )
case TR_STATUS_DOWNLOAD:
g_string_append_printf( gstr,
ngettext( "Downloading from %1$d of %2$d connected peer",
"Downloading from %1$d of %2$d connected peers",
ngettext( "Downloading from %1$'d of %2$'d connected peer",
"Downloading from %1$'d of %2$'d connected peers",
torStat->peersConnected ),
torStat->peersSendingToUs,
torStat->peersConnected );
@ -205,8 +205,8 @@ getStatusString( const tr_stat * torStat )
case TR_STATUS_DONE:
case TR_STATUS_SEED:
g_string_append_printf( gstr,
ngettext( "Seeding to %1$d of %2$d connected peer",
"Seeding to %1$d of %2$d connected peers",
ngettext( "Seeding to %1$'d of %2$'d connected peer",
"Seeding to %1$'d of %2$'d connected peers",
torStat->peersConnected ),
torStat->peersGettingFromUs,
torStat->peersConnected );

View File

@ -63,11 +63,11 @@ refresh_tooltip_cb( gpointer data )
tr_strlspeed( downStr, stats->clientDownloadSpeed, sizeof( downStr ) );
tr_strlspeed( upStr, stats->clientUploadSpeed, sizeof( upStr ) );
g_snprintf( tip, sizeof( tip ),
/* %1$d is the number of torrents we're seeding,
%2$d is the number of torrents we're downloading,
/* %1$'d is the number of torrents we're seeding,
%2$'d is the number of torrents we're downloading,
%3$s is our download speed,
%4$s is our upload speed */
_( "%1$d Seeding, %2$d Downloading\nDown: %3$s, Up: %4$s" ),
_( "%1$'d Seeding, %2$'d Downloading\nDown: %3$s, Up: %4$s" ),
stats->seedingCount,
stats->downloadCount,
downStr, upStr );

View File

@ -297,15 +297,15 @@ tr_torrent_status_str ( TrTorrent * gtor )
case TR_STATUS_DONE:
top = g_strdup_printf(
ngettext( "Uploading to %1$d of %2$d connected peer",
"Uploading to %1$d of %2$d connected peers", tpeers ),
ngettext( "Uploading to %1$'d of %2$'d connected peer",
"Uploading to %1$'d of %2$'d connected peers", tpeers ),
upeers, tpeers );
break;
case TR_STATUS_SEED:
top = g_strdup_printf(
ngettext( "Seeding to %1$d of %2$d connected peer",
"Seeding to %1$d of %2$d connected peers", tpeers ),
ngettext( "Seeding to %1$'d of %2$'d connected peer",
"Seeding to %1$'d of %2$'d connected peers", tpeers ),
upeers, tpeers );
break;

View File

@ -596,13 +596,13 @@ updateTorrentCount( PrivateData * p )
const int visibleCount = gtk_tree_model_iter_n_children( p->filter_model, NULL );
if( torrentCount != visibleCount )
g_snprintf( buf, sizeof( buf ), ngettext( "%1$d of %2$d Torrent",
"%1$d of %2$d Torrents",
g_snprintf( buf, sizeof( buf ), ngettext( "%1$'d of %2$'d Torrent",
"%1$'d of %2$'d Torrents",
torrentCount ),
visibleCount, torrentCount );
else
g_snprintf( buf, sizeof( buf ), ngettext( "%d Torrent",
"%d Torrents",
g_snprintf( buf, sizeof( buf ), ngettext( "%'d Torrent",
"%'d Torrents",
torrentCount ),
torrentCount );
gtk_label_set_text( GTK_LABEL( p->gutter_lb ), buf );

View File

@ -107,13 +107,13 @@ tr_strlspeed( char * buf, double kb_sec, size_t buflen )
const double speed = kb_sec;
if ( speed < 1000.0 ) /* 0.0 KB to 999.9 KB */
g_snprintf( buf, buflen, _( "%.1f KB/s" ), speed );
g_snprintf( buf, buflen, _( "%'.1f KB/s" ), speed );
else if( speed < 102400.0 ) /* 0.98 MB to 99.99 MB */
g_snprintf( buf, buflen, _( "%.2f MB/s" ), (speed/1024) );
g_snprintf( buf, buflen, _( "%'.2f MB/s" ), (speed/1024) );
else if( speed < 1024000.0 ) /* 100.0 MB to 999.9 MB */
g_snprintf( buf, buflen, _( "%.1f MB/s" ), (speed/1024) );
g_snprintf( buf, buflen, _( "%'.1f MB/s" ), (speed/1024) );
else /* insane speeds */
g_snprintf( buf, buflen, _( "%.2f GB/s" ), (speed/1048576) );
g_snprintf( buf, buflen, _( "%'.2f GB/s" ), (speed/1048576) );
return buf;
}

View File

@ -641,7 +641,7 @@ fastResumeLoadImpl ( tr_torrent * tor,
ret |= parseVersion1 ( tor, walk, end, fieldsToLoad );
else
/* %s is the torrent name */
tr_torinf( tor, _( "Skipping invalid resume file for \"%s\"" ), tor->info.name );
tr_torinf( tor, _( "Couldn't read resume file for \"%s\"" ), tor->info.name );
}
tr_free( buf );

View File

@ -276,7 +276,7 @@ tr_metainfoParse( tr_info * inf, const tr_benc * meta_in, const char * tag )
if( !inf->fileCount || !inf->totalSize )
{
tr_err( _( "Torrent is empty" ) );
tr_err( _( "Torrent is corrupt" ) ); /* the content is missing! */
goto fail;
}

View File

@ -136,7 +136,7 @@ tr_natpmpPulse( struct tr_natpmp * nat, int port, int isEnabled )
const int val = readnatpmpresponseorretry( &nat->natpmp, &response );
logVal( "readnatpmpresponseorretry", val );
if( val >= 0 ) {
tr_ninf( getKey(), _( "found public address %s" ), inet_ntoa( response.publicaddress.addr ) );
tr_ninf( getKey(), _( "Found public address \"%s\"" ), inet_ntoa( response.publicaddress.addr ) );
nat->state = TR_NATPMP_IDLE;
} else if( val != NATPMP_TRYAGAIN ) {
setErrorState( nat );

View File

@ -69,13 +69,13 @@ getNatStateStr( int state )
switch( state )
{
/* we're in the process of trying to set up port forwarding */
case TR_NAT_TRAVERSAL_MAPPING: return _( "starting" );
case TR_NAT_TRAVERSAL_MAPPING: return _( "Starting" );
/* we've successfully forwarded the port */
case TR_NAT_TRAVERSAL_MAPPED: return _( "forwarded" );
case TR_NAT_TRAVERSAL_MAPPED: return _( "Forwarded" );
/* we're cancelling the port forwarding */
case TR_NAT_TRAVERSAL_UNMAPPING: return _( "stopping" );
case TR_NAT_TRAVERSAL_UNMAPPING: return _( "Stopping" );
/* the port isn't forwarded */
case TR_NAT_TRAVERSAL_UNMAPPED: return _( "not forwarded" );
case TR_NAT_TRAVERSAL_UNMAPPED: return _( "Not forwarded" );
case TR_NAT_TRAVERSAL_ERROR: return "???";
}

View File

@ -157,13 +157,13 @@ onTrackerResponse( void * tracker UNUSED, void * vevent, void * user_data )
break;
case TR_TRACKER_WARNING:
tr_torerr( tor, _( "Tracker warning: %s" ), event->text );
tr_torerr( tor, _( "Tracker warning: \"%s\"" ), event->text );
tor->error = TR_ERROR_TC_WARNING;
strlcpy( tor->errorString, event->text, sizeof(tor->errorString) );
break;
case TR_TRACKER_ERROR:
tr_torerr( tor, _( "Tracker error: %s" ), event->text );
tr_torerr( tor, _( "Tracker error: \"%s\"" ), event->text );
tor->error = TR_ERROR_TC_ERROR;
strlcpy( tor->errorString, event->text, sizeof(tor->errorString) );
break;
@ -1052,6 +1052,10 @@ getCompletionString( int type )
{
switch( type )
{
/* Translators: this is a minor point that's safe to skip over, but FYI:
"Complete" and "Done" are specific, different terms in Transmission:
"Complete" means we've downloaded every file in the torrent.
"Done" means we're done downloading the files we wanted, but NOT all that exist */
case TR_CP_DONE: return _( "Done" );
case TR_CP_COMPLETE: return _( "Complete" );
default: return _( "Incomplete" );

View File

@ -117,7 +117,7 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
UPNP_DeletePortMapping( handle->urls.controlURL,
handle->data.servicetype,
portStr, "TCP" );
tr_ninf( getKey(), _( "Stopping port forwarding of \"%s\", service \"%s\"" ),
tr_ninf( getKey(), _( "Stopping port forwarding through \"%s\", service \"%s\"" ),
handle->urls.controlURL, handle->data.servicetype );
handle->isMapped = 0;
handle->state = TR_UPNP_IDLE;
@ -146,7 +146,7 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
"Transmission", "TCP" );
handle->isMapped = !err;
}
tr_ninf( getKey(), _( "Port forwarding via \"%s\", service \"%s\". (local address: %s:%d)" ),
tr_ninf( getKey(), _( "Port forwarding through \"%s\", service \"%s\". (local address: %s:%d)" ),
handle->urls.controlURL, handle->data.servicetype, handle->lanaddr, port );
if( handle->isMapped ) {
tr_ninf( getKey(), _( "Port forwarding successful!" ) );