mirror of
https://github.com/transmission/transmission
synced 2025-02-21 21:57:01 +00:00
(gtk) #1108: transmission includes several unlocalized strings
This commit is contained in:
parent
776b5fc63b
commit
9c0646553a
4 changed files with 13 additions and 8 deletions
|
@ -789,7 +789,7 @@ refresh_time_lb( GtkWidget * l, time_t t )
|
|||
if( !t )
|
||||
gtk_label_set_text( GTK_LABEL( l ), never );
|
||||
else {
|
||||
char * str = rfc822date( t );
|
||||
char * str = gtr_localtime( t );
|
||||
gtk_label_set_text( GTK_LABEL( l ), str );
|
||||
g_free( str );
|
||||
}
|
||||
|
|
|
@ -97,13 +97,15 @@ doSave( GtkWindow * parent,
|
|||
gtk_tree_model_get( model, &iter,
|
||||
COL_TR_MSG, &node,
|
||||
-1 );
|
||||
date = rfc822date( node->when );
|
||||
date = gtr_localtime( node->when );
|
||||
switch( node->level ) {
|
||||
case TR_MSG_DBG: levelStr = "debug"; break;
|
||||
case TR_MSG_ERR: levelStr = "error"; break;
|
||||
default: levelStr = " "; break;
|
||||
}
|
||||
fprintf( fp, "%s\t%s\t%s\t%s\n", date, levelStr, node->name, node->message );
|
||||
fprintf( fp, "%s\t%s\t%s\t%s\n", date, levelStr,
|
||||
( node->name ? node->name : "" ),
|
||||
( node->message ? node->message : "" ) );
|
||||
|
||||
g_free( date );
|
||||
}
|
||||
|
|
11
gtk/util.c
11
gtk/util.c
|
@ -159,13 +159,16 @@ tr_strltime( char * buf, int seconds, size_t buflen )
|
|||
return buf;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
rfc822date( time_t time )
|
||||
gtr_localtime( time_t time )
|
||||
{
|
||||
const struct tm tm = *localtime( &time );
|
||||
char buf[128];
|
||||
strftime( buf, sizeof(buf), "%a, %d %b %Y %T %Z", &tm );
|
||||
char buf[256], *eoln;
|
||||
|
||||
g_strlcpy( buf, asctime( &tm ), sizeof( buf ) );
|
||||
if(( eoln = strchr( buf, '\n' )))
|
||||
*eoln = '\0';
|
||||
|
||||
return g_locale_to_utf8( buf, -1, NULL, NULL, NULL );
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ char* tr_strlratio( char * buf, double ratio, size_t buflen );
|
|||
/* return a human-readable string for the time given in seconds. */
|
||||
char* tr_strltime( char * buf, int secs, size_t buflen );
|
||||
|
||||
char* rfc822date( time_t epoch_sec );
|
||||
char* gtr_localtime( time_t time );
|
||||
|
||||
/* create a directory and any missing parent directories */
|
||||
gboolean
|
||||
|
|
Loading…
Reference in a new issue