Changeset 12412


Ignore:
Timestamp:
May 2, 2011, 5:58:27 PM (10 years ago)
Author:
jordan
Message:

(trunk gtk) use ngettext() instead of gtr_dngettext() to address https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/760761

Location:
trunk/gtk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r12400 r12412  
    773773            tr_formatter_mem_B( piecebuf, pieceSize, sizeof( piecebuf ) );
    774774            g_snprintf( buf, sizeof( buf ),
    775                         gtr_ngettext( "%1$s (%2$'d piece @ %3$s)",
     775                        ngettext( "%1$s (%2$'d piece @ %3$s)",
    776776                                      "%1$s (%2$'d pieces @ %3$s)", pieces ),
    777777                        sizebuf, pieces, piecebuf );
     
    779779        } else {
    780780            g_snprintf( buf, sizeof( buf ),
    781                         gtr_ngettext( "%1$s (%2$'d piece)",
     781                        ngettext( "%1$s (%2$'d piece)",
    782782                                      "%1$s (%2$'d pieces)", pieces ),
    783783                        sizebuf, pieces );
  • trunk/gtk/dialogs.c

    r12068 r12412  
    9393    if( !delete_files )
    9494    {
    95         g_string_printf( primary_text, gtr_ngettext( "Remove torrent?",
    96                                                      "Remove %d torrents?",
    97                                                      count ), count );
     95        g_string_printf( primary_text, ngettext( "Remove torrent?",
     96                                                 "Remove %d torrents?",
     97                                                 count ), count );
    9898    }
    9999    else
    100100    {
    101         g_string_printf( primary_text, gtr_ngettext( "Delete this torrent's downloaded files?",
    102                                                      "Delete these %d torrents' downloaded files?",
    103                                                      count ), count );
     101        g_string_printf( primary_text, ngettext( "Delete this torrent's downloaded files?",
     102                                                 "Delete these %d torrents' downloaded files?",
     103                                                 count ), count );
    104104    }
    105105
     
    108108    if( !incomplete && !connected )
    109109    {
    110         g_string_assign( secondary_text, gtr_ngettext(
     110        g_string_assign( secondary_text, ngettext(
    111111                "Once removed, continuing the transfer will require the torrent file or magnet link.",
    112112                "Once removed, continuing the transfers will require the torrent files or magnet links.",
     
    115115    else if( count == incomplete )
    116116    {
    117         g_string_assign( secondary_text, gtr_ngettext( "This torrent has not finished downloading.",
    118                                                        "These torrents have not finished downloading.",
    119                                                        count ) );
     117        g_string_assign( secondary_text, ngettext( "This torrent has not finished downloading.",
     118                                                   "These torrents have not finished downloading.",
     119                                                   count ) );
    120120    }
    121121    else if( count == connected )
    122122    {
    123         g_string_assign( secondary_text, gtr_ngettext( "This torrent is connected to peers.",
    124                                                        "These torrents are connected to peers.",
    125                                                        count ) );
     123        g_string_assign( secondary_text, ngettext( "This torrent is connected to peers.",
     124                                                   "These torrents are connected to peers.",
     125                                                   count ) );
    126126    }
    127127    else
    128128    {
    129129        if( connected )
    130             g_string_append( secondary_text, gtr_ngettext( "One of these torrents is connected to peers.",
    131                                                            "Some of these torrents are connected to peers.",
     130            g_string_append( secondary_text, ngettext( "One of these torrents is connected to peers.",
     131                                                       "Some of these torrents are connected to peers.",
    132132                                                       connected ) );
    133133        if( connected && incomplete )
     
    135135
    136136        if( incomplete )
    137             g_string_assign( secondary_text, gtr_ngettext( "One of these torrents has not finished downloading.",
    138                                                            "Some of these torrents have not finished downloading.",
     137            g_string_assign( secondary_text, ngettext( "One of these torrents has not finished downloading.",
     138                                                       "Some of these torrents have not finished downloading.",
    139139                                                       incomplete ) );
    140140    }
  • trunk/gtk/main.c

    r12355 r12412  
    13411341    if( cbdata->error_list )
    13421342        show_torrent_errors( cbdata->wind,
    1343                               gtr_ngettext( "Couldn't add corrupt torrent",
    1344                                             "Couldn't add corrupt torrents",
    1345                                             g_slist_length( cbdata->error_list ) ),
     1343                              ngettext( "Couldn't add corrupt torrent",
     1344                                        "Couldn't add corrupt torrents",
     1345                                        g_slist_length( cbdata->error_list ) ),
    13461346                              &cbdata->error_list );
    13471347
    13481348    if( cbdata->duplicates_list )
    13491349        show_torrent_errors( cbdata->wind,
    1350                               gtr_ngettext( "Couldn't add duplicate torrent",
    1351                                             "Couldn't add duplicate torrents",
    1352                                             g_slist_length( cbdata->duplicates_list ) ),
     1350                              ngettext( "Couldn't add duplicate torrent",
     1351                                        "Couldn't add duplicate torrents",
     1352                                        g_slist_length( cbdata->duplicates_list ) ),
    13531353                              &cbdata->duplicates_list );
    13541354}
  • trunk/gtk/makemeta-ui.c

    r12233 r12412  
    296296        char buf[128];
    297297        tr_strlsize( buf, builder->totalSize, sizeof( buf ) );
    298         g_string_append_printf( gstr, gtr_ngettext( "%1$s; %2$'d File",
    299                                                     "%1$s; %2$'d Files",
    300                                                     builder->fileCount ),
     298        g_string_append_printf( gstr, ngettext( "%1$s; %2$'d File",
     299                                                "%1$s; %2$'d Files",
     300                                                builder->fileCount ),
    301301                                buf, builder->fileCount );
    302302        g_string_append( gstr, "; " );
    303303
    304304        tr_formatter_mem_B( buf, builder->pieceSize, sizeof( buf ) );
    305         g_string_append_printf( gstr, gtr_ngettext( "%1$'d Piece @ %2$s",
    306                                                     "%1$'d Pieces @ %2$s",
    307                                                     builder->pieceCount ),
     305        g_string_append_printf( gstr, ngettext( "%1$'d Piece @ %2$s",
     306                                                "%1$'d Pieces @ %2$s",
     307                                                builder->pieceCount ),
    308308                                      builder->pieceCount, buf );
    309309    }
  • trunk/gtk/stats.c

    r12092 r12412  
    7070    setLabelFromRatio( ui->one_ratio_lb, one.ratio );
    7171
    72     fmt = gtr_ngettext( "Started %'d time", "Started %'d times",
    73                         (int)all.sessionCount );
     72    fmt = ngettext( "Started %'d time", "Started %'d times",
     73                     (int)all.sessionCount );
    7474    g_snprintf( buf, buflen, fmt, (int)all.sessionCount );
    7575    setLabel( ui->all_sessions_lb, buf );
  • trunk/gtk/torrent-cell-renderer.c

    r12352 r12412  
    280280            {
    281281                g_string_append_printf( gstr,
    282                     gtr_ngettext( "Downloading from %1$'d of %2$'d connected peer",
    283                                   "Downloading from %1$'d of %2$'d connected peers",
    284                                   st->webseedsSendingToUs + st->peersSendingToUs ),
     282                    ngettext( "Downloading from %1$'d of %2$'d connected peer",
     283                              "Downloading from %1$'d of %2$'d connected peers",
     284                              st->webseedsSendingToUs + st->peersSendingToUs ),
    285285                    st->webseedsSendingToUs + st->peersSendingToUs,
    286286                    st->webseedsSendingToUs + st->peersConnected );
     
    289289            {
    290290                g_string_append_printf( gstr,
    291                     gtr_ngettext( "Downloading metadata from %1$'d peer (%2$d%% done)",
    292                                   "Downloading metadata from %1$'d peers (%2$d%% done)",
    293                                   st->peersConnected + st->peersConnected ),
     291                    ngettext( "Downloading metadata from %1$'d peer (%2$d%% done)",
     292                              "Downloading metadata from %1$'d peers (%2$d%% done)",
     293                              st->peersConnected + st->peersConnected ),
    294294                    st->peersConnected + st->webseedsSendingToUs,
    295295                    (int)(100.0*st->metadataPercentComplete) );
     
    300300        case TR_STATUS_SEED:
    301301            g_string_append_printf( gstr,
    302                 gtr_ngettext( "Seeding to %1$'d of %2$'d connected peer",
    303                               "Seeding to %1$'d of %2$'d connected peers",
    304                               st->peersConnected ),
     302                ngettext( "Seeding to %1$'d of %2$'d connected peer",
     303                          "Seeding to %1$'d of %2$'d connected peers",
     304                          st->peersConnected ),
    305305                st->peersGettingFromUs,
    306306                st->peersConnected );
  • trunk/gtk/tr-prefs.c

    r12407 r12412  
    395395    const int n = tr_blocklistGetRuleCount( gtr_core_session( core ) );
    396396    g_snprintf( buf1, sizeof( buf1 ),
    397                 gtr_ngettext( "Blocklist contains %'d rule",
    398                               "Blocklist contains %'d rules", n ), n );
     397                ngettext( "Blocklist contains %'d rule",
     398                          "Blocklist contains %'d rules", n ), n );
    399399    g_snprintf( buf2, sizeof( buf2 ), "<i>%s</i>", buf1 );
    400400    gtk_label_set_markup( GTK_LABEL( w ), buf2 );
     
    428428    const bool success = n >= 0;
    429429    const int count = n >=0 ? n : tr_blocklistGetRuleCount( gtr_core_session( core ) );
    430     const char * s = gtr_ngettext( "Blocklist has %'d rule.", "Blocklist has %'d rules.", count );
     430    const char * s = ngettext( "Blocklist has %'d rule.", "Blocklist has %'d rules.", count );
    431431    struct blocklist_data * data = gdata;
    432432    GtkMessageDialog * d = GTK_MESSAGE_DIALOG( data->updateBlocklistDialog );
  • trunk/gtk/tr-window.c

    r12356 r12412  
    749749        else if( torrentCount != visibleCount )
    750750            g_snprintf( buf, sizeof( buf ),
    751                         gtr_ngettext( "%1$'d of %2$'d Torrent",
    752                                       "%1$'d of %2$'d Torrents",
    753                                       torrentCount ),
     751                        ngettext( "%1$'d of %2$'d Torrent",
     752                                  "%1$'d of %2$'d Torrents",
     753                                  torrentCount ),
    754754                        visibleCount, torrentCount );
    755755        else
    756756            g_snprintf( buf, sizeof( buf ),
    757                         gtr_ngettext( "%'d Torrent", "%'d Torrents", torrentCount ),
     757                        ngettext( "%'d Torrent", "%'d Torrents", torrentCount ),
    758758                        torrentCount );
    759759        gtr_label_set_text( GTK_LABEL( p->gutter_lb ), buf );
  • trunk/gtk/util.c

    r12396 r12412  
    161161    seconds = ( seconds % 3600 ) % 60;
    162162
    163     g_snprintf( d, sizeof( d ), gtr_ngettext( "%'d day", "%'d days", days ), days );
    164     g_snprintf( h, sizeof( h ), gtr_ngettext( "%'d hour", "%'d hours", hours ), hours );
    165     g_snprintf( m, sizeof( m ), gtr_ngettext( "%'d minute", "%'d minutes", minutes ), minutes );
    166     g_snprintf( s, sizeof( s ), gtr_ngettext( "%'d second", "%'d seconds", seconds ), seconds );
     163    g_snprintf( d, sizeof( d ), ngettext( "%'d day", "%'d days", days ), days );
     164    g_snprintf( h, sizeof( h ), ngettext( "%'d hour", "%'d hours", hours ), hours );
     165    g_snprintf( m, sizeof( m ), ngettext( "%'d minute", "%'d minutes", minutes ), minutes );
     166    g_snprintf( s, sizeof( s ), ngettext( "%'d second", "%'d seconds", seconds ), seconds );
    167167
    168168    if( days )
     
    372372#endif
    373373    return object;
    374 }
    375 
    376 const gchar *
    377 gtr_ngettext( const gchar * msgid,
    378               const gchar * msgid_plural,
    379               gulong n )
    380 {
    381 #if GLIB_CHECK_VERSION( 2, 18, 0 )
    382     return g_dngettext( NULL, msgid, msgid_plural, n );
    383 #else
    384     return ngettext( msgid, msgid_plural, n );
    385 #endif
    386374}
    387375
  • trunk/gtk/util.h

    r12306 r12412  
    133133gpointer gtr_object_ref_sink( gpointer object );
    134134
    135 /* backwards-compatible wrapper around g_dngettext() */
    136 const gchar* gtr_ngettext( const gchar*, const gchar*, gulong );
    137 
    138135void gtr_dialog_set_content( GtkDialog * dialog, GtkWidget * content );
    139136
Note: See TracChangeset for help on using the changeset viewer.