mirror of
https://github.com/transmission/transmission
synced 2025-03-03 10:15:45 +00:00
(gtk) small string folding & i18n tweaks.
This commit is contained in:
parent
a896a594c1
commit
7bb54cece8
5 changed files with 18 additions and 12 deletions
|
@ -38,6 +38,10 @@ action_cb ( GtkAction * a, gpointer user_data )
|
|||
#define GTK_STOCK_INFO GTK_STOCK_PROPERTIES
|
||||
#endif
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,10,0)
|
||||
#define GTK_STOCK_SELECT_ALL NULL
|
||||
#endif
|
||||
|
||||
static GtkRadioActionEntry sort_radio_entries[] =
|
||||
{
|
||||
{ "sort-by-activity", NULL, N_("Sort by _Activity"), NULL, NULL, 0 },
|
||||
|
@ -113,7 +117,7 @@ static GtkActionEntry entries[] =
|
|||
N_("Close main window"),
|
||||
G_CALLBACK(action_cb) },
|
||||
{ "quit", GTK_STOCK_QUIT, N_("_Quit"), NULL, NULL, G_CALLBACK(action_cb) },
|
||||
{ "select-all", NULL,
|
||||
{ "select-all", GTK_STOCK_SELECT_ALL,
|
||||
N_( "Select _All" ), "<control>A", NULL, G_CALLBACK(action_cb) },
|
||||
{ "unselect-all", NULL,
|
||||
N_("Dese_lect All"), "<shift><control>A", NULL, G_CALLBACK(action_cb) },
|
||||
|
|
|
@ -201,7 +201,7 @@ openSingleTorrentDialog( GtkWindow * parent,
|
|||
|
||||
++row;
|
||||
col = 0;
|
||||
l = gtk_label_new_with_mnemonic( _( "Destination _folder:" ) );
|
||||
l = gtk_label_new_with_mnemonic( _( "_Destination folder:" ) );
|
||||
gtk_misc_set_alignment( GTK_MISC( l ), 0.0f, 0.5f );
|
||||
gtk_table_attach( GTK_TABLE( t ), l, col, col+1, row, row+1, GTK_FILL, 0, 0, 0 );
|
||||
++col;
|
||||
|
|
|
@ -47,6 +47,7 @@ setLabelFromRatio( GtkWidget * w, double d )
|
|||
static gboolean
|
||||
updateStats( gpointer gdata )
|
||||
{
|
||||
const char * fmt;
|
||||
char buf[128];
|
||||
|
||||
struct stat_ui * ui = gdata;
|
||||
|
@ -59,7 +60,8 @@ updateStats( gpointer gdata )
|
|||
setLabel( ui->one_time_lb, tr_strltime( buf, one.secondsActive, sizeof(buf) ) );
|
||||
setLabelFromRatio( ui->one_ratio_lb, one.ratio );
|
||||
|
||||
g_snprintf( buf, sizeof( buf ), _( "Started %d times" ), (int)all.sessionCount );
|
||||
fmt = ngettext( "Started %'d time", "Started %'d times", (int)all.sessionCount );
|
||||
g_snprintf( buf, sizeof(buf), fmt, (int)all.sessionCount );
|
||||
setLabel( ui->all_sessions_lb, buf );
|
||||
setLabel( ui->all_up_lb, tr_strlsize( buf, all.uploadedBytes, sizeof(buf) ) );
|
||||
setLabel( ui->all_down_lb, tr_strlsize( buf, all.downloadedBytes, sizeof(buf) ) );
|
||||
|
|
|
@ -252,7 +252,7 @@ torrentPage( GObject * core )
|
|||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
w = new_path_chooser_button( PREF_KEY_DIR_DEFAULT, core );
|
||||
hig_workarea_add_row( t, &row, _( "Default destination _folder:" ), w, NULL );
|
||||
hig_workarea_add_row( t, &row, _( "_Destination folder:" ), w, NULL );
|
||||
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
hig_workarea_add_section_divider( t, &row );
|
||||
|
@ -339,7 +339,7 @@ networkPage( GObject * core, gpointer alive )
|
|||
l = gtk_label_new( NULL );
|
||||
gtk_misc_set_alignment( GTK_MISC(l), 0.0f, 0.5f );
|
||||
gtk_box_pack_start( GTK_BOX(h), l, FALSE, FALSE, 0 );
|
||||
hig_workarea_add_row( t, &row, _("Incoming TCP _port:"), h, w );
|
||||
hig_workarea_add_row( t, &row, _("Incoming _port:"), h, w );
|
||||
|
||||
g_object_set_data( G_OBJECT(l), "tr-port-spin", w2 );
|
||||
g_object_set_data( G_OBJECT(l), "alive", alive );
|
||||
|
|
14
gtk/util.c
14
gtk/util.c
|
@ -58,11 +58,11 @@ tr_strlratio( char * buf, double ratio, size_t buflen )
|
|||
else if( (int)ratio == TR_RATIO_INF )
|
||||
g_strlcpy( buf, "\xE2\x88\x9E", buflen );
|
||||
else if( ratio < 10.0 )
|
||||
g_snprintf( buf, buflen, "%.2f", ratio );
|
||||
g_snprintf( buf, buflen, "%'.2f", ratio );
|
||||
else if( ratio < 100.0 )
|
||||
g_snprintf( buf, buflen, "%.1f", ratio );
|
||||
g_snprintf( buf, buflen, "%'.1f", ratio );
|
||||
else
|
||||
g_snprintf( buf, buflen, "%.0f", ratio );
|
||||
g_snprintf( buf, buflen, "%'.0f", ratio );
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -83,18 +83,18 @@ tr_strlsize( char * buf, guint64 size, size_t buflen )
|
|||
}
|
||||
#else
|
||||
else if( size < (guint64)KILOBYTE_FACTOR )
|
||||
g_snprintf( buf, buflen, ngettext("%u byte", "%u bytes", (guint)size), (guint)size );
|
||||
g_snprintf( buf, buflen, ngettext("%'u byte", "%'u bytes", (guint)size), (guint)size );
|
||||
else {
|
||||
gdouble displayed_size;
|
||||
if (size < (guint64)MEGABYTE_FACTOR) {
|
||||
displayed_size = (gdouble) size / KILOBYTE_FACTOR;
|
||||
g_snprintf( buf, buflen, _("%.1f KB"), displayed_size );
|
||||
g_snprintf( buf, buflen, _("%'.1f KB"), displayed_size );
|
||||
} else if (size < (guint64)GIGABYTE_FACTOR) {
|
||||
displayed_size = (gdouble) size / MEGABYTE_FACTOR;
|
||||
g_snprintf( buf, buflen, _("%.1f MB"), displayed_size );
|
||||
g_snprintf( buf, buflen, _("%'.1f MB"), displayed_size );
|
||||
} else {
|
||||
displayed_size = (gdouble) size / GIGABYTE_FACTOR;
|
||||
g_snprintf( buf, buflen, _("%.1f GB"), displayed_size );
|
||||
g_snprintf( buf, buflen, _("%'.1f GB"), displayed_size );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue