char piecebuf[128];
tr_formatter_mem_B( piecebuf, pieceSize, sizeof( piecebuf ) );
g_snprintf( buf, sizeof( buf ),
- gtr_ngettext( "%1$s (%2$'d piece @ %3$s)",
+ ngettext( "%1$s (%2$'d piece @ %3$s)",
"%1$s (%2$'d pieces @ %3$s)", pieces ),
sizebuf, pieces, piecebuf );
str = buf;
} else {
g_snprintf( buf, sizeof( buf ),
- gtr_ngettext( "%1$s (%2$'d piece)",
+ ngettext( "%1$s (%2$'d piece)",
"%1$s (%2$'d pieces)", pieces ),
sizebuf, pieces );
str = buf;
if( !delete_files )
{
- g_string_printf( primary_text, gtr_ngettext( "Remove torrent?",
- "Remove %d torrents?",
- count ), count );
+ g_string_printf( primary_text, ngettext( "Remove torrent?",
+ "Remove %d torrents?",
+ count ), count );
}
else
{
- g_string_printf( primary_text, gtr_ngettext( "Delete this torrent's downloaded files?",
- "Delete these %d torrents' downloaded files?",
- count ), count );
+ g_string_printf( primary_text, ngettext( "Delete this torrent's downloaded files?",
+ "Delete these %d torrents' downloaded files?",
+ count ), count );
}
secondary_text = g_string_new( NULL );
if( !incomplete && !connected )
{
- g_string_assign( secondary_text, gtr_ngettext(
+ g_string_assign( secondary_text, ngettext(
"Once removed, continuing the transfer will require the torrent file or magnet link.",
"Once removed, continuing the transfers will require the torrent files or magnet links.",
count ) );
}
else if( count == incomplete )
{
- g_string_assign( secondary_text, gtr_ngettext( "This torrent has not finished downloading.",
- "These torrents have not finished downloading.",
- count ) );
+ g_string_assign( secondary_text, ngettext( "This torrent has not finished downloading.",
+ "These torrents have not finished downloading.",
+ count ) );
}
else if( count == connected )
{
- g_string_assign( secondary_text, gtr_ngettext( "This torrent is connected to peers.",
- "These torrents are connected to peers.",
- count ) );
+ g_string_assign( secondary_text, ngettext( "This torrent is connected to peers.",
+ "These torrents are connected to peers.",
+ count ) );
}
else
{
if( connected )
- g_string_append( secondary_text, gtr_ngettext( "One of these torrents is connected to peers.",
- "Some of these torrents are connected to peers.",
+ g_string_append( secondary_text, ngettext( "One of these torrents is connected to peers.",
+ "Some of these torrents are connected to peers.",
connected ) );
if( connected && incomplete )
g_string_append( secondary_text, "\n" );
if( incomplete )
- g_string_assign( secondary_text, gtr_ngettext( "One of these torrents has not finished downloading.",
- "Some of these torrents have not finished downloading.",
+ g_string_assign( secondary_text, ngettext( "One of these torrents has not finished downloading.",
+ "Some of these torrents have not finished downloading.",
incomplete ) );
}
{
if( cbdata->error_list )
show_torrent_errors( cbdata->wind,
- gtr_ngettext( "Couldn't add corrupt torrent",
- "Couldn't add corrupt torrents",
- g_slist_length( cbdata->error_list ) ),
+ ngettext( "Couldn't add corrupt torrent",
+ "Couldn't add corrupt torrents",
+ g_slist_length( cbdata->error_list ) ),
&cbdata->error_list );
if( cbdata->duplicates_list )
show_torrent_errors( cbdata->wind,
- gtr_ngettext( "Couldn't add duplicate torrent",
- "Couldn't add duplicate torrents",
- g_slist_length( cbdata->duplicates_list ) ),
+ ngettext( "Couldn't add duplicate torrent",
+ "Couldn't add duplicate torrents",
+ g_slist_length( cbdata->duplicates_list ) ),
&cbdata->duplicates_list );
}
{
char buf[128];
tr_strlsize( buf, builder->totalSize, sizeof( buf ) );
- g_string_append_printf( gstr, gtr_ngettext( "%1$s; %2$'d File",
- "%1$s; %2$'d Files",
- builder->fileCount ),
+ g_string_append_printf( gstr, ngettext( "%1$s; %2$'d File",
+ "%1$s; %2$'d Files",
+ builder->fileCount ),
buf, builder->fileCount );
g_string_append( gstr, "; " );
tr_formatter_mem_B( buf, builder->pieceSize, sizeof( buf ) );
- g_string_append_printf( gstr, gtr_ngettext( "%1$'d Piece @ %2$s",
- "%1$'d Pieces @ %2$s",
- builder->pieceCount ),
+ g_string_append_printf( gstr, ngettext( "%1$'d Piece @ %2$s",
+ "%1$'d Pieces @ %2$s",
+ builder->pieceCount ),
builder->pieceCount, buf );
}
g_string_append( gstr, "</i>" );
setLabel( ui->one_time_lb, tr_strltime( buf, one.secondsActive, buflen ) );
setLabelFromRatio( ui->one_ratio_lb, one.ratio );
- fmt = gtr_ngettext( "Started %'d time", "Started %'d times",
- (int)all.sessionCount );
+ fmt = ngettext( "Started %'d time", "Started %'d times",
+ (int)all.sessionCount );
g_snprintf( buf, buflen, fmt, (int)all.sessionCount );
setLabel( ui->all_sessions_lb, buf );
setLabel( ui->all_up_lb, tr_strlsize( buf, all.uploadedBytes, buflen ) );
if( tr_torrentHasMetadata( tor ) )
{
g_string_append_printf( gstr,
- gtr_ngettext( "Downloading from %1$'d of %2$'d connected peer",
- "Downloading from %1$'d of %2$'d connected peers",
- st->webseedsSendingToUs + st->peersSendingToUs ),
+ ngettext( "Downloading from %1$'d of %2$'d connected peer",
+ "Downloading from %1$'d of %2$'d connected peers",
+ st->webseedsSendingToUs + st->peersSendingToUs ),
st->webseedsSendingToUs + st->peersSendingToUs,
st->webseedsSendingToUs + st->peersConnected );
}
else
{
g_string_append_printf( gstr,
- gtr_ngettext( "Downloading metadata from %1$'d peer (%2$d%% done)",
- "Downloading metadata from %1$'d peers (%2$d%% done)",
- st->peersConnected + st->peersConnected ),
+ ngettext( "Downloading metadata from %1$'d peer (%2$d%% done)",
+ "Downloading metadata from %1$'d peers (%2$d%% done)",
+ st->peersConnected + st->peersConnected ),
st->peersConnected + st->webseedsSendingToUs,
(int)(100.0*st->metadataPercentComplete) );
}
case TR_STATUS_SEED:
g_string_append_printf( gstr,
- gtr_ngettext( "Seeding to %1$'d of %2$'d connected peer",
- "Seeding to %1$'d of %2$'d connected peers",
- st->peersConnected ),
+ ngettext( "Seeding to %1$'d of %2$'d connected peer",
+ "Seeding to %1$'d of %2$'d connected peers",
+ st->peersConnected ),
st->peersGettingFromUs,
st->peersConnected );
break;
char buf2[512];
const int n = tr_blocklistGetRuleCount( gtr_core_session( core ) );
g_snprintf( buf1, sizeof( buf1 ),
- gtr_ngettext( "Blocklist contains %'d rule",
- "Blocklist contains %'d rules", n ), n );
+ ngettext( "Blocklist contains %'d rule",
+ "Blocklist contains %'d rules", n ), n );
g_snprintf( buf2, sizeof( buf2 ), "<i>%s</i>", buf1 );
gtk_label_set_markup( GTK_LABEL( w ), buf2 );
}
{
const bool success = n >= 0;
const int count = n >=0 ? n : tr_blocklistGetRuleCount( gtr_core_session( core ) );
- const char * s = gtr_ngettext( "Blocklist has %'d rule.", "Blocklist has %'d rules.", count );
+ const char * s = ngettext( "Blocklist has %'d rule.", "Blocklist has %'d rules.", count );
struct blocklist_data * data = gdata;
GtkMessageDialog * d = GTK_MESSAGE_DIALOG( data->updateBlocklistDialog );
gtk_widget_set_sensitive( data->updateBlocklistButton, TRUE );
*buf = '\0';
else if( torrentCount != visibleCount )
g_snprintf( buf, sizeof( buf ),
- gtr_ngettext( "%1$'d of %2$'d Torrent",
- "%1$'d of %2$'d Torrents",
- torrentCount ),
+ ngettext( "%1$'d of %2$'d Torrent",
+ "%1$'d of %2$'d Torrents",
+ torrentCount ),
visibleCount, torrentCount );
else
g_snprintf( buf, sizeof( buf ),
- gtr_ngettext( "%'d Torrent", "%'d Torrents", torrentCount ),
+ ngettext( "%'d Torrent", "%'d Torrents", torrentCount ),
torrentCount );
gtr_label_set_text( GTK_LABEL( p->gutter_lb ), buf );
}
minutes = ( seconds % 3600 ) / 60;
seconds = ( seconds % 3600 ) % 60;
- g_snprintf( d, sizeof( d ), gtr_ngettext( "%'d day", "%'d days", days ), days );
- g_snprintf( h, sizeof( h ), gtr_ngettext( "%'d hour", "%'d hours", hours ), hours );
- g_snprintf( m, sizeof( m ), gtr_ngettext( "%'d minute", "%'d minutes", minutes ), minutes );
- g_snprintf( s, sizeof( s ), gtr_ngettext( "%'d second", "%'d seconds", seconds ), seconds );
+ g_snprintf( d, sizeof( d ), ngettext( "%'d day", "%'d days", days ), days );
+ g_snprintf( h, sizeof( h ), ngettext( "%'d hour", "%'d hours", hours ), hours );
+ g_snprintf( m, sizeof( m ), ngettext( "%'d minute", "%'d minutes", minutes ), minutes );
+ g_snprintf( s, sizeof( s ), ngettext( "%'d second", "%'d seconds", seconds ), seconds );
if( days )
{
return object;
}
-const gchar *
-gtr_ngettext( const gchar * msgid,
- const gchar * msgid_plural,
- gulong n )
-{
-#if GLIB_CHECK_VERSION( 2, 18, 0 )
- return g_dngettext( NULL, msgid, msgid_plural, n );
-#else
- return ngettext( msgid, msgid_plural, n );
-#endif
-}
-
int
gtr_file_trash_or_remove( const char * filename )
{
/* backwards-compatible wrapper around g_object_ref_sink() */
gpointer gtr_object_ref_sink( gpointer object );
-/* backwards-compatible wrapper around g_dngettext() */
-const gchar* gtr_ngettext( const gchar*, const gchar*, gulong );
-
void gtr_dialog_set_content( GtkDialog * dialog, GtkWidget * content );
/***