Make some messages translatable.

This commit is contained in:
jean-pierre charras 2011-03-26 11:08:50 +01:00
parent 9a27065f51
commit 137d132985
8 changed files with 53 additions and 31 deletions

View File

@ -1884,10 +1884,13 @@ const char** LIB_PIN::GetMenuImage() const
wxString LIB_PIN::GetSelectMenuText() const
{
wxString tmp = _( "Pin " );
return tmp << GetNumberString() << wxT( ", " ) << GetTypeString() << wxT( ", " )
<< wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] );;
wxString tmp;
tmp.Printf( _( "Pin %s, %s, %s" ),
GetChars( GetNumberString() ),
GetChars( GetTypeString() ),
GetChars( wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] ) )
);
return tmp;
}

View File

@ -1633,9 +1633,11 @@ LIB_DRAW_ITEM* SCH_COMPONENT::GetDrawItem( const wxPoint& aPosition, KICAD_T aTy
wxString SCH_COMPONENT::GetSelectMenuText() const
{
wxString tmp = _( "Component " );
return tmp << m_ChipName << wxT( ", " ) << GetField( REFERENCE )->GetText();
wxString tmp;
tmp.Printf( _( "Component %s, %s" ),
GetChars( m_ChipName ),
GetChars( GetField( REFERENCE )->GetText() ) );
return tmp;
}

View File

@ -449,9 +449,10 @@ void SCH_FIELD::Rotate( wxPoint rotationPoint )
wxString SCH_FIELD::GetSelectMenuText() const
{
wxString tmp = _( "Field " );
wxString tmp;
tmp.Printf( _( "Field %s" ), GetChars( + GetName() ) );
return tmp + GetName();
return tmp;
}

View File

@ -419,31 +419,35 @@ void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const
wxString SCH_LINE::GetSelectMenuText() const
{
wxString menuText;
wxString menuText, txtfmt, orient;
if( m_Start.x == m_End.x )
orient = _("Vert.");
else if( m_Start.y == m_End.y )
orient = _("Horiz.");
switch( m_Layer )
{
case LAYER_NOTES:
menuText = _( "Graphic Line " );
txtfmt = _( "%s Graphic Line from (%s,%s) to (%s,%s) " );
break;
case LAYER_WIRE:
menuText = _( "Wire " );
txtfmt = _( "%s Wire from (%s,%s) to (%s,%s)" );
break;
case LAYER_BUS:
menuText = _( "Bus " );
txtfmt = _( "%s Bus from (%s,%s) to (%s,%s)" );
break;
default:
menuText = _( "Line on Unkown Layer " );
txtfmt += _( "%s Line on Unkown Layer from (%s,%s) to (%s,%s)" );
}
menuText << wxT( "from (" ) << CoordinateToString( m_Start.x, EESCHEMA_INTERNAL_UNIT )
<< wxT( "," ) << CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT )
<< wxT( ")" );
menuText << wxT( " to (" ) << CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT )
<< wxT( "," ) << CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT ) << wxT( ")" );
menuText.Printf( txtfmt, GetChars( orient ),
GetChars(CoordinateToString( m_Start.x, EESCHEMA_INTERNAL_UNIT )),
GetChars(CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT )),
GetChars(CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT )),
GetChars(CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT )) );
return menuText;
}

View File

@ -207,27 +207,27 @@ void SCH_POLYLINE::Rotate( wxPoint rotationPoint )
wxString SCH_POLYLINE::GetSelectMenuText() const
{
wxString menuText;
wxString menuText, fmt;
switch( m_Layer )
{
case LAYER_NOTES:
menuText = _( "Graphic Polyline " );
fmt = _( "Graphic Polyline with %d Points" );
break;
case LAYER_WIRE:
menuText = _( "Polyline Wire " );
fmt = _( "Polyline Wire with %d Points" );
break;
case LAYER_BUS:
menuText = _( "Polyline Bus " );
fmt = _( "Polyline Bus with %d Points" );
break;
default:
menuText = _( "Polyline on Unkown Layer " );
fmt = _( "Polyline on Unkown Layer with %d Points" );
}
menuText += wxString::Format( _( "with %d Points" ), m_PolyPoints.size() );
menuText.Printf( fmt, m_PolyPoints.size() );
return menuText;
}

View File

@ -983,7 +983,9 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR* aInspector, const void* aTestData,
wxString SCH_SHEET::GetSelectMenuText() const
{
return wxString( _( "Hierarchical Sheet " ) ) + m_SheetName;
wxString tmp;
tmp.Printf( _( "Hierarchical Sheet " ), GetChars( m_SheetName ) );
return tmp;
}

View File

@ -461,7 +461,9 @@ void SCH_SHEET_PIN::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
wxString SCH_SHEET_PIN::GetSelectMenuText() const
{
return wxString( _( "Hierarchical Sheet Label " ) ) + GetText();
wxString tmp;
tmp.Printf( _( "Hierarchical Sheet Label %s" ), GetChars( GetText() ) );
return tmp;
}

View File

@ -628,7 +628,9 @@ wxString SCH_TEXT::GetSelectMenuText() const
tmp.Replace( wxT( "\t" ), wxT( " " ) );
tmp =( tmp.Length() > 15 ) ? tmp.Left( 12 ) + wxT( "..." ) : tmp;
return wxString( _( "Graphic Text " ) ) + tmp;
wxString msg;
msg.Printf(_( "Graphic Text %s" ), GetChars(tmp));
return msg;
}
@ -859,7 +861,9 @@ wxString SCH_LABEL::GetSelectMenuText() const
{
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText();
return wxString( _( "Label " ) ) + tmp;
wxString msg;
msg.Printf( _( "Label %s" ), GetChars(tmp) );
return msg;
}
@ -1290,7 +1294,9 @@ wxString SCH_GLOBALLABEL::GetSelectMenuText() const
{
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText();
return wxString( _( "Global Label " ) ) + tmp;
wxString msg;
msg.Printf( _( "Global Label %s" ), GetChars(tmp) );
return msg;
}
@ -1645,7 +1651,9 @@ wxString SCH_HIERLABEL::GetSelectMenuText() const
{
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText();
return wxString( _( "Hierarchical Label " ) ) + tmp;
wxString msg;
msg.Printf( _( "Hierarchical Label %s" ), GetChars( tmp ) );
return msg;
}