Changeset 5223


Ignore:
Timestamp:
Mar 7, 2008, 9:59:27 PM (14 years ago)
Author:
charles
Message:

(gtk) more i18n string work w/suggestions from andre and vuntz to use format strings with positions to allow argument reordering.

Location:
trunk/gtk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r5222 r5223  
    787787  g_free (pch);
    788788
    789   pch = g_strdup_printf( _( "%.1f%% (%.1f%% selected)" ), stat->percentComplete*100.0, stat->percentDone*100.0 );
     789  /* Translators: %1$.1f is percent of how much of what we want has been downloaded,
     790                  %2$.1f is percent of how much of the whole torrent we've downloaded */
     791  pch = g_strdup_printf( _( "%1$.1f%% (%2$.1f%% selected)" ), stat->percentComplete*100.0, stat->percentDone*100.0 );
    790792  gtk_label_set_text (GTK_LABEL(a->progress_lb), pch);
    791793  g_free (pch);
     
    793795  tr_strlsize( sizeStr,  stat->haveValid + stat->haveUnchecked, sizeof(sizeStr) );
    794796  tr_strlsize( sizeStr2, stat->haveValid,                       sizeof(sizeStr2) );
    795   g_snprintf( buf, sizeof(buf), _("%s (%s verified)"), sizeStr, sizeStr2 );
     797  /* Translators: %1$s is total size of what we've saved to disk, %2$s is how much of it's passed the checksum test */
     798  g_snprintf( buf, sizeof(buf), _("%1$s (%2$s verified)"), sizeStr, sizeStr2 );
    796799  gtk_label_set_text( GTK_LABEL( a->have_lb ), buf );
    797800
     
    12351238  /* create the dialog */
    12361239  tr_strlsize( sizeStr, info->totalSize, sizeof(sizeStr) );
    1237   /* Translators: first %s is torrent name, second is file size */
    1238   g_snprintf( title, sizeof(title), _( "Details for %s (%s)" ), info->name, sizeStr );
     1240  /* Translators: %1$s is torrent name, %2$s is file size */
     1241  g_snprintf( title, sizeof(title), _( "Details for %1$s (%2$s)" ), info->name, sizeStr );
    12391242  d = gtk_dialog_new_with_buttons (title, parent, 0,
    12401243                                   GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
  • trunk/gtk/main.c

    r5221 r5223  
    760760                joined = joinstrlist( cbdata->errqueue, "\n" );
    761761                errmsg( cbdata->wind,
    762                         ngettext( "Failed to load torrent file:\n%s",
    763                                   "Failed to load torrent files:\n%s",
     762                        ngettext( "Failed to load torrent file: %s",
     763                                  "Failed to load torrent files: %s",
    764764                                  g_list_length( cbdata->errqueue ) ),
    765765                        joined );
  • trunk/gtk/torrent-cell-renderer.c

    r5208 r5223  
    4848    if( !isDone )
    4949        str = g_strdup_printf(
    50                   _("%s of %s (%.2f%%)"),
     50                  /* Translators: %1$s is how much we've got, %2$s is how much we'll have when done, %3$.2f%% is a percentage of the two */
     51                  _("%1$s of %2$s (%3$.2f%%)"),
    5152                  tr_strlsize( buf1, haveTotal, sizeof(buf1) ),
    5253                  tr_strlsize( buf2, torStat->desiredSize, sizeof(buf2) ),
     
    5455    else if( !isSeed )
    5556        str = g_strdup_printf(
    56                   _("%s of %s (%.2f%%), uploaded %s (Ratio: %s)"),
     57                  /* Translators: %1$s is how much we've got, %2$s is the torrent's total size, %3$.2f%% is a percentage of the two,
     58                     %4$s is how much we've uploaded, %5$s is our upload-to-download ratio */
     59                  _("%1$s of %2$s (%3$.2f%%), uploaded %4$s (Ratio: %5$s)"),
    5760                  tr_strlsize( buf1, haveTotal, sizeof(buf1) ),
    5861                  tr_strlsize( buf2, info->totalSize, sizeof(buf2) ),
     
    6265    else
    6366        str = g_strdup_printf(
    64                   _("%s, uploaded %s (Ratio: %s)"),
     67                  /* Translators: %1$s is the torrent's total size, %2$s is how much we've uploaded,
     68                     %3$s is our upload-to-download ratio */
     69                  _("%1$s, uploaded %2$s (Ratio: %3$s)"),
    6570                  tr_strlsize( buf1, info->totalSize, sizeof(buf1) ),
    6671                  tr_strlsize( buf2, torStat->uploadedEver, sizeof(buf2) ),
     
    100105
    101106    if( haveDown && haveUp )
    102         g_snprintf( buf, buflen, _( "Down: %s, Up: %s"), downStr, upStr );
     107        /* Translators: %1$s is download speed, %2$s is upload speed */
     108        g_snprintf( buf, buflen, _( "Down: %1$s, Up: %2$s"), downStr, upStr );
    103109    else if( haveDown )
     110        /* Translators: this refers to download speed */
    104111        g_snprintf( buf, buflen, _( "Down: %s" ), downStr );
    105112    else if( haveUp )
     113        /* Translators: this refers to upload speed */
    106114        g_snprintf( buf, buflen, _( "Up: %s" ), upStr );
    107115    else
     116        /* Translators: the torrent isn't uploading or downloading */
    108117        g_strlcpy( buf, _( "Idle" ), buflen );
    109118
     
    137146            if( torStat->status != TR_STATUS_DOWNLOAD ) {
    138147                tr_strlratio( buf, torStat->ratio, sizeof( buf ) );
    139                 g_string_append_printf( gstr, _("Ratio: %s, " ), buf );
     148                g_string_append_printf( gstr, _("Ratio: %s" ), buf );
     149                g_string_append( gstr, ", " );
    140150            }
    141151            getShortTransferString( torStat, buf, sizeof( buf ) );
     
    177187        case TR_STATUS_DOWNLOAD:
    178188            g_string_append_printf( gstr,
    179                 ngettext( "Downloading from %d of %d connected peer",
    180                           "Downloading from %d of %d connected peers",
     189                ngettext( "Downloading from %1$d of %2$d connected peer",
     190                          "Downloading from %1$d of %2$d connected peers",
    181191                          torStat->peersConnected ),
    182192                torStat->peersSendingToUs,
     
    187197        case TR_STATUS_SEED:
    188198            g_string_append_printf( gstr,
    189                 ngettext( "Seeding to %d of %d connected peer",
    190                           "Seeding to %d of %d connected peers",
     199                ngettext( "Seeding to %1$d of %2$d connected peer",
     200                          "Seeding to %1$d of %2$d connected peers",
    191201                          torStat->peersConnected ),
    192202                torStat->peersGettingFromUs,
  • trunk/gtk/tr-icon.c

    r5122 r5223  
    7676    tr_strlspeed( upStr, stats->clientUploadSpeed, sizeof( upStr ) );
    7777    g_snprintf( tip, sizeof( tip ),
    78                 _( "%d Seeding, %d Downloading\nDown: %s, Up: %s" ),
     78                /* Translators: %1$d is the number of torrents we're seeding,
     79                                %2$d is the number of torrents we're downloading,
     80                                %3$s is our download speed,
     81                                %4$s is our upload speed */
     82                _( "%1$d Seeding, %2$d Downloading\nDown: %3$s, Up: %4$s" ),
    7983                stats->seedingCount,
    8084                stats->downloadCount,
  • trunk/gtk/tr-window.c

    r5222 r5223  
    633633        tr_strlsize( up, stats.uploadedBytes, sizeof( up ) );
    634634        tr_strlsize( down, stats.downloadedBytes, sizeof( down ) );
    635         g_snprintf( buf, sizeof( buf ), _( "Down: %s, Up: %s" ), down, up );
     635        /* Translators: %1$s is downloaded byte count, %2$s is uploaded byte count*/
     636        g_snprintf( buf, sizeof( buf ), _( "Down: %1$s, Up: %2$s" ), down, up );
    636637    } else if( !strcmp( pch, "total-transfer" ) ) {
    637638        tr_getCumulativeSessionStats( handle, &stats );
    638639        tr_strlsize( up, stats.uploadedBytes, sizeof( up ) );
    639640        tr_strlsize( down, stats.downloadedBytes, sizeof( down ) );
    640         g_snprintf( buf, sizeof( buf ), _( "Down: %s, Up: %s" ), down, up );
     641        /* Translators: %1$s is downloaded byte count, %2$s is uploaded byte count*/
     642        g_snprintf( buf, sizeof( buf ), _( "Down: %1$s, Up: %2$s" ), down, up );
    641643    } else { /* default is total-ratio */
    642644        tr_getCumulativeSessionStats( handle, &stats );
Note: See TracChangeset for help on using the changeset viewer.