Changeset 5290


Ignore:
Timestamp:
Mar 18, 2008, 7:14:21 PM (14 years ago)
Author:
charles
Message:

strings work: (1) folding similar strings together for easier tranlation (2) gtk: use consistent shortcuts/phrases/terminology between the preferences and "open torrent" dialogs (3) promote the port forwarding messages from Debug to Info as per BMW's request

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/file-list.c

    r5226 r5290  
    7575stringToPriority( const char* str )
    7676{
    77     if( !strcmp( str, _( "High" ) ) ) return TR_PRI_HIGH;
    78     if( !strcmp( str, _( "Low" ) ) ) return TR_PRI_LOW;
     77    if( !strcmp( str, priorityToString( TR_PRI_HIGH ) ) ) return TR_PRI_HIGH;
     78    if( !strcmp( str, priorityToString( TR_PRI_LOW ) ) ) return TR_PRI_LOW;
    7979    return TR_PRI_NORMAL;
    8080}
     
    246246  GtkListStore * store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
    247247  gtk_list_store_append (store, &iter);
    248   gtk_list_store_set (store, &iter, 0, _("High"), 1, TR_PRI_HIGH, -1);
     248  gtk_list_store_set (store, &iter, 0, priorityToString( TR_PRI_HIGH ), 1, TR_PRI_HIGH, -1);
    249249  gtk_list_store_append (store, &iter);
    250   gtk_list_store_set (store, &iter, 0, _("Normal"), 1, TR_PRI_NORMAL, -1);
     250  gtk_list_store_set (store, &iter, 0, priorityToString( TR_PRI_NORMAL ), 1, TR_PRI_NORMAL, -1);
    251251  gtk_list_store_append (store, &iter);
    252   gtk_list_store_set (store, &iter, 0, _("Low"), 1, TR_PRI_LOW, -1);
     252  gtk_list_store_set (store, &iter, 0, priorityToString( TR_PRI_LOW ), 1, TR_PRI_LOW, -1);
    253253  return GTK_TREE_MODEL (store);
    254254}
  • trunk/gtk/msgwin.c

    r5269 r5290  
    3030{
    3131    COL_SEQUENCE,
    32     COL_CATEGORY,
     32    COL_NAME,
    3333    COL_MESSAGE,
    3434    COL_TR_MSG,
     
    8181    {
    8282        errmsg( parent,
    83                 _("Couldn't write file \"%s\": %s"),
     83                _("Couldn't save file \"%s\": %s"),
    8484                filename, g_strerror( errno ) );
    8585    }
     
    220220    switch( col ) {
    221221        case COL_SEQUENCE: title = _( "Time" ); break;
    222         case COL_CATEGORY: title = _( "Name"); break;
     222        /* noun.  column title for a list */
     223        case COL_NAME: title = _( "Name"); break;
     224        /* noun.  column title for a list */
    223225        case COL_MESSAGE:  title = _( "Message" ); break;
    224226        default: g_assert_not_reached( );
     
    227229    switch( col )
    228230    {
    229         case COL_CATEGORY:
     231        case COL_NAME:
    230232            r = gtk_cell_renderer_text_new( );
    231233            c = gtk_tree_view_column_new_with_attributes( title, r, NULL );
     
    281283addMessages( GtkListStore * store, struct tr_msg_list * head )
    282284{
    283     const char * default_category = g_get_application_name( );
     285    const char * default_name = g_get_application_name( );
    284286    static int sequence = 1;
    285287    tr_msg_list * i;
     
    291293        gtk_list_store_insert_with_values( store, &unused, 0,
    292294                                           COL_TR_MSG, i,
    293                                            COL_CATEGORY, ( i->name ? i->name : default_category ),
     295                                           COL_NAME, ( i->name ? i->name : default_name ),
    294296                                           COL_MESSAGE, i->message,
    295297                                           COL_SEQUENCE, sequence++,
     
    440442    gtk_tree_view_set_rules_hint( data->view, TRUE );
    441443    appendColumn( data->view, COL_SEQUENCE );
    442     appendColumn( data->view, COL_CATEGORY );
     444    appendColumn( data->view, COL_NAME );
    443445    appendColumn( data->view, COL_MESSAGE );
    444446    w = gtk_scrolled_window_new( NULL, NULL );
  • trunk/gtk/open-dialog.c

    r5283 r5290  
    164164    data->destination = g_strdup( str );
    165165    data->list = file_list_new( NULL );
    166     data->trash_check = gtk_check_button_new_with_mnemonic( _( "_Trash original torrent file" ) );
    167     data->run_check = gtk_check_button_new_with_mnemonic( _( "_Start when added" ) );
     166    data->trash_check = gtk_check_button_new_with_mnemonic( _( "Mo_ve source file to Trash" ) );
     167    data->run_check = gtk_check_button_new_with_mnemonic( _( "_Start when opened" ) );
    168168
    169169    g_signal_connect( G_OBJECT( d ), "response",
     
    176176
    177177    row = col = 0;
    178     l = gtk_label_new_with_mnemonic( _( "_Torrent file:" ) );
     178    l = gtk_label_new_with_mnemonic( _( "_Source file:" ) );
    179179    gtk_misc_set_alignment( GTK_MISC( l ), 0.0f, 0.5f );
    180180    gtk_table_attach( GTK_TABLE( t ), l, col, col+1, row, row+1, GTK_FILL, 0, 0, 0 );
     
    225225    ++row;
    226226    col = 0;
     227    w = data->run_check;
     228    if( tr_ctorGetPaused( ctor, TR_FORCE, &flag ) )
     229        g_assert_not_reached( );
     230    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), !flag );
     231    gtk_table_attach( GTK_TABLE( t ), w, col, col+2, row, row+1, GTK_FILL, 0, 0, 0 );
     232
     233    ++row;
     234    col = 0;
    227235    w = data->trash_check;
    228236    if( tr_ctorGetDeleteSource( ctor, &flag ) )
    229237        g_assert_not_reached( );
    230238    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), flag );
    231     gtk_table_attach( GTK_TABLE( t ), w, col, col+2, row, row+1, GTK_FILL, 0, 0, 0 );
    232 
    233     ++row;
    234     col = 0;
    235     w = data->run_check;
    236     if( tr_ctorGetPaused( ctor, TR_FORCE, &flag ) )
    237         g_assert_not_reached( );
    238     gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), !flag );
    239239    gtk_table_attach( GTK_TABLE( t ), w, col, col+2, row, row+1, GTK_FILL, 0, 0, 0 );
    240240
  • trunk/gtk/tr-prefs.c

    r5276 r5290  
    222222    GtkWidget * t;
    223223    GtkWidget * w;
     224#ifdef HAVE_GIO
    224225    GtkWidget * l;
     226#endif
    225227
    226228    t = hig_workarea_create( );
    227     hig_workarea_add_section_title( t, &row, _( "Adding" ) );
     229    hig_workarea_add_section_title( t, &row, _( "Opening Torrents" ) );
    228230
    229231#ifdef HAVE_GIO
     
    236238#endif
    237239
    238         s = _( "_Prompt for file selections and priorities" );
     240        s = _( "Display _options dialog" );
    239241        w = new_check_button( s, PREF_KEY_OPTIONS_PROMPT, core );
    240242        hig_workarea_add_wide_control( t, &row, w );
    241243
    242         s = _( "_Start torrents when added" );
     244        s = _( "_Start when opened" );
    243245        w = new_check_button( s, PREF_KEY_START, core );
    244246        hig_workarea_add_wide_control( t, &row, w );
    245247
    246         s = _( "_Trash original torrent files" );
     248        s = _( "Mo_ve source files to Trash" );
    247249        w = new_check_button( s, PREF_KEY_TRASH_ORIGINAL, core );
    248250        hig_workarea_add_wide_control( t, &row, w );
     
    326328    hig_workarea_add_section_title (t, &row, _("Ports"));
    327329       
    328         s = _("_Forward port from router with UPnP or NAT-PMP" );
     330        s = _("_Forward port from router" );
    329331        w = new_check_button( s, PREF_KEY_NAT, core );
    330332        hig_workarea_add_wide_control( t, &row, w );
    331333
    332         h = gtk_hbox_new( FALSE, GUI_PAD );
     334        h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
    333335        w2 = new_spin_button( PREF_KEY_PORT, core, 1, INT_MAX, 1 );
    334336        gtk_box_pack_start( GTK_BOX(h), w2, FALSE, FALSE, 0 );
     
    336338        gtk_misc_set_alignment( GTK_MISC(l), 0.0f, 0.5f );
    337339        gtk_box_pack_start( GTK_BOX(h), l, FALSE, FALSE, 0 );
    338         hig_workarea_add_row( t, &row, _("Incoming TCP _port"), h, w );
     340        hig_workarea_add_row( t, &row, _("Incoming TCP _port:"), h, w );
    339341
    340342        g_object_set_data( G_OBJECT(l), "tr-port-spin", w2 );
  • trunk/libtransmission/metainfo.c

    r5221 r5290  
    617617    if( fwrite( buf, 1, buflen, file ) != buflen )
    618618    {
    619         tr_err( _( "Couldn't write file \"%s\": %s" ), path, tr_strerror( errno ) );
     619        tr_err( _( "Couldn't save file \"%s\": %s" ), path, tr_strerror( errno ) );
    620620        fclose( file );
    621621        return TR_EINVALID;
  • trunk/libtransmission/natpmp.c

    r5279 r5290  
    6666{
    6767    if( ret==NATPMP_TRYAGAIN )
    68         tr_ndbg( getKey(), _( "%s responded 'try again'" ), func );
     68        tr_ninf( getKey(), _( "%s responded 'try again'" ), func );
    6969    else if( ret >= 0 )
    70         tr_ndbg( getKey(), _( "%s succeeded (%d)" ), func, ret );
     70        tr_ninf( getKey(), _( "%s succeeded (%d)" ), func, ret );
    7171    else
    72         tr_ndbg( getKey(), _( "%s failed (%d): %s (%d)" ), func, ret, tr_strerror(errno), errno );
     72        tr_ninf( getKey(), _( "%s failed (%d): %s (%d)" ), func, ret, tr_strerror(errno), errno );
    7373}
    7474
     
    110110setErrorState( struct tr_natpmp * nat )
    111111{
    112     tr_ndbg( getKey(), _( "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ) );
    113     tr_ndbg( getKey(), _( "NAT-PMP port forwarding unsuccessful, trying UPnP next" ) );
     112    tr_ninf( getKey(), _( "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ) );
     113    tr_ninf( getKey(), _( "NAT-PMP port forwarding unsuccessful, trying UPnP next" ) );
    114114    nat->state = TR_NATPMP_ERR;
    115115}
  • trunk/libtransmission/net.c

    r5208 r5290  
    9393#endif
    9494        {
    95             tr_err( _( "Couldn't set socket to non-blocking mode: %s" ),
     95            tr_err( _( "Couldn't create socket: %s" ),
    9696                    tr_strerror( sockerrno ) );
    9797            tr_netClose( fd );
  • trunk/libtransmission/shared.c

    r5281 r5290  
    9797        s->natStatus = status;
    9898        if( status == TR_NAT_TRAVERSAL_ERROR )
    99             tr_nerr( getKey(), _( "Port forwarding failed.  Turn on debug messages and restart for more information." ) );
     99            tr_nerr( getKey(), _( "Port forwarding failed." ) );
    100100    }
    101101}
     
    160160    else if( ( shared->natStatus == TR_NAT_TRAVERSAL_ERROR ) || ( shared->natStatus == TR_NAT_TRAVERSAL_UNMAPPED ) )
    161161    {
    162         tr_ndbg( getKey(), _( "Stopped" ) );
     162        tr_ninf( getKey(), _( "Stopped" ) );
    163163        shared->h->shared = NULL;
    164164        tr_netClose( shared->bindSocket );
  • trunk/libtransmission/upnp.c

    r5279 r5290  
    8989        devlist = upnpDiscover( 2000, NULL, NULL );
    9090        if( devlist == NULL ) {
    91             tr_ndbg( getKey(), _( "upnpDiscover failed (errno %d - %s)" ), errno, tr_strerror(errno) );
     91            tr_ninf( getKey(), _( "upnpDiscover failed (errno %d - %s)" ), errno, tr_strerror(errno) );
    9292        }
    9393        errno = 0;
    9494        if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) {
    95             tr_ndbg( getKey(), _( "Found Internet Gateway Device \"%s\"" ), handle->urls.controlURL );
    96             tr_ndbg( getKey(), _( "Local Address is \"%s\"" ), handle->lanaddr );
     95            tr_ninf( getKey(), _( "Found Internet Gateway Device \"%s\"" ), handle->urls.controlURL );
     96            tr_ninf( getKey(), _( "Local Address is \"%s\"" ), handle->lanaddr );
    9797            handle->state = TR_UPNP_IDLE;
    9898            handle->hasDiscovered = 1;
    9999        } else {
    100100            handle->state = TR_UPNP_ERR;
    101             tr_ndbg( getKey(), _( "UPNP_GetValidIGD failed (errno %d - %s)" ), errno, tr_strerror(errno) );
    102             tr_ndbg( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
     101            tr_ninf( getKey(), _( "UPNP_GetValidIGD failed (errno %d - %s)" ), errno, tr_strerror(errno) );
     102            tr_ninf( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
    103103        }
    104104        freeUPNPDevlist( devlist );
     
    118118                                handle->data.servicetype,
    119119                                portStr, "TCP" );
    120         tr_ndbg( getKey(), _( "Stopping port forwarding of \"%s\", service \"%s\"" ),
     120        tr_ninf( getKey(), _( "Stopping port forwarding of \"%s\", service \"%s\"" ),
    121121                handle->urls.controlURL, handle->data.servicetype );
    122122        handle->isMapped = 0;
     
    154154            handle->state = TR_UPNP_IDLE;
    155155        } else {
    156             tr_ndbg( getKey(), _( "Port forwarding failed with error %d (%d - %s)" ), err, errno, tr_strerror(errno) );
    157             tr_ndbg( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
     156            tr_ninf( getKey(), _( "Port forwarding failed with error %d (%d - %s)" ), err, errno, tr_strerror(errno) );
     157            tr_ninf( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
    158158            handle->port = -1;
    159159            handle->state = TR_UPNP_ERR;
Note: See TracChangeset for help on using the changeset viewer.