1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-21 21:57:01 +00:00

(gtk) #930: Patch to reorder format string args for translation

This commit is contained in:
Charles Kerr 2008-06-03 20:13:22 +00:00
parent 1a234d951c
commit 7ee61d138c
2 changed files with 17 additions and 11 deletions

View file

@ -741,20 +741,23 @@ info_page_new (tr_torrent * tor)
GtkWidget *l, *w, *fr;
char *pch;
char sizeStr[128];
char countStr[128];
char buf[256];
GtkTextBuffer * b;
const tr_info * info = tr_torrentInfo(tor);
hig_workarea_add_section_title (t, &row, _("Details"));
g_snprintf( countStr, sizeof( countStr ),
ngettext( "%d Piece", "%d Pieces", info->pieceCount ),
info->pieceCount );
tr_strlsize( sizeStr, info->pieceSize, sizeof(sizeStr) );
g_snprintf( buf, sizeof( buf ),
/* %1$'d is number of pieces
/* %1$s is number of pieces;
%2$s is how big each piece is */
ngettext( "%1$'d Piece @ %2$s",
"%1$'d Pieces @ %2$s",
info->pieceCount ),
info->pieceCount, sizeStr );
_( "%1$s @ %2$s" ),
countStr, sizeStr );
l = gtk_label_new (buf);
hig_workarea_add_row (t, &row, _("Pieces:"), l, NULL);
@ -878,7 +881,7 @@ refresh_activity (GtkWidget * top)
gtk_label_set_text (GTK_LABEL(a->err_lb),
*stat->errorString ? stat->errorString : _("None"));
refresh_time_lb( a->date_added_lb, stat->startDate );
refresh_time_lb( a->date_added_lb, stat->addedDate );
refresh_time_lb( a->last_activity_lb, stat->activityDate );

View file

@ -233,14 +233,17 @@ refreshFromBuilder( MakeMetaUI * ui )
if( !filename )
*buf = '\0';
else {
char countStr[512];
g_snprintf( countStr, sizeof( countStr ),
ngettext( "%d Piece", "%d Pieces", builder->pieceCount ),
builder->pieceCount );
tr_strlsize( sizeStr, builder->pieceSize, sizeof(sizeStr) );
g_snprintf( buf, sizeof( buf ),
/* %1$'s is number of pieces;
/* %1$s is number of pieces;
%2$s is how big each piece is */
ngettext( "<i>%1$'d Piece @ %2$s</i>",
"<i>%1$'d Pieces @ %2$s</i>",
builder->pieceCount ),
builder->pieceCount, sizeStr );
_( "%1$s @ %2$s" ),
countStr,
sizeStr );
}
gtk_label_set_markup ( GTK_LABEL(ui->pieces_lb), buf );
}