Commit 137d1329 authored by jean-pierre charras's avatar jean-pierre charras

Make some messages translatable.

parent 9a27065f
...@@ -1884,10 +1884,13 @@ const char** LIB_PIN::GetMenuImage() const ...@@ -1884,10 +1884,13 @@ const char** LIB_PIN::GetMenuImage() const
wxString LIB_PIN::GetSelectMenuText() const wxString LIB_PIN::GetSelectMenuText() const
{ {
wxString tmp = _( "Pin " ); wxString tmp;
tmp.Printf( _( "Pin %s, %s, %s" ),
return tmp << GetNumberString() << wxT( ", " ) << GetTypeString() << wxT( ", " ) GetChars( GetNumberString() ),
<< wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] );; GetChars( GetTypeString() ),
GetChars( wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] ) )
);
return tmp;
} }
......
...@@ -1633,9 +1633,11 @@ LIB_DRAW_ITEM* SCH_COMPONENT::GetDrawItem( const wxPoint& aPosition, KICAD_T aTy ...@@ -1633,9 +1633,11 @@ LIB_DRAW_ITEM* SCH_COMPONENT::GetDrawItem( const wxPoint& aPosition, KICAD_T aTy
wxString SCH_COMPONENT::GetSelectMenuText() const wxString SCH_COMPONENT::GetSelectMenuText() const
{ {
wxString tmp = _( "Component " ); wxString tmp;
tmp.Printf( _( "Component %s, %s" ),
return tmp << m_ChipName << wxT( ", " ) << GetField( REFERENCE )->GetText(); GetChars( m_ChipName ),
GetChars( GetField( REFERENCE )->GetText() ) );
return tmp;
} }
......
...@@ -449,9 +449,10 @@ void SCH_FIELD::Rotate( wxPoint rotationPoint ) ...@@ -449,9 +449,10 @@ void SCH_FIELD::Rotate( wxPoint rotationPoint )
wxString SCH_FIELD::GetSelectMenuText() const wxString SCH_FIELD::GetSelectMenuText() const
{ {
wxString tmp = _( "Field " ); wxString tmp;
tmp.Printf( _( "Field %s" ), GetChars( + GetName() ) );
return tmp + GetName(); return tmp;
} }
......
...@@ -419,31 +419,35 @@ void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const ...@@ -419,31 +419,35 @@ void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const
wxString SCH_LINE::GetSelectMenuText() 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 ) switch( m_Layer )
{ {
case LAYER_NOTES: case LAYER_NOTES:
menuText = _( "Graphic Line " ); txtfmt = _( "%s Graphic Line from (%s,%s) to (%s,%s) " );
break; break;
case LAYER_WIRE: case LAYER_WIRE:
menuText = _( "Wire " ); txtfmt = _( "%s Wire from (%s,%s) to (%s,%s)" );
break; break;
case LAYER_BUS: case LAYER_BUS:
menuText = _( "Bus " ); txtfmt = _( "%s Bus from (%s,%s) to (%s,%s)" );
break; break;
default: 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 ) menuText.Printf( txtfmt, GetChars( orient ),
<< wxT( "," ) << CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT ) GetChars(CoordinateToString( m_Start.x, EESCHEMA_INTERNAL_UNIT )),
<< wxT( ")" ); GetChars(CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT )),
menuText << wxT( " to (" ) << CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT ) GetChars(CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT )),
<< wxT( "," ) << CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT ) << wxT( ")" ); GetChars(CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT )) );
return menuText; return menuText;
} }
......
...@@ -207,27 +207,27 @@ void SCH_POLYLINE::Rotate( wxPoint rotationPoint ) ...@@ -207,27 +207,27 @@ void SCH_POLYLINE::Rotate( wxPoint rotationPoint )
wxString SCH_POLYLINE::GetSelectMenuText() const wxString SCH_POLYLINE::GetSelectMenuText() const
{ {
wxString menuText; wxString menuText, fmt;
switch( m_Layer ) switch( m_Layer )
{ {
case LAYER_NOTES: case LAYER_NOTES:
menuText = _( "Graphic Polyline " ); fmt = _( "Graphic Polyline with %d Points" );
break; break;
case LAYER_WIRE: case LAYER_WIRE:
menuText = _( "Polyline Wire " ); fmt = _( "Polyline Wire with %d Points" );
break; break;
case LAYER_BUS: case LAYER_BUS:
menuText = _( "Polyline Bus " ); fmt = _( "Polyline Bus with %d Points" );
break; break;
default: 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; return menuText;
} }
......
...@@ -983,7 +983,9 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR* aInspector, const void* aTestData, ...@@ -983,7 +983,9 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR* aInspector, const void* aTestData,
wxString SCH_SHEET::GetSelectMenuText() const wxString SCH_SHEET::GetSelectMenuText() const
{ {
return wxString( _( "Hierarchical Sheet " ) ) + m_SheetName; wxString tmp;
tmp.Printf( _( "Hierarchical Sheet " ), GetChars( m_SheetName ) );
return tmp;
} }
......
...@@ -461,7 +461,9 @@ void SCH_SHEET_PIN::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) ...@@ -461,7 +461,9 @@ void SCH_SHEET_PIN::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
wxString SCH_SHEET_PIN::GetSelectMenuText() const wxString SCH_SHEET_PIN::GetSelectMenuText() const
{ {
return wxString( _( "Hierarchical Sheet Label " ) ) + GetText(); wxString tmp;
tmp.Printf( _( "Hierarchical Sheet Label %s" ), GetChars( GetText() ) );
return tmp;
} }
......
...@@ -628,7 +628,9 @@ wxString SCH_TEXT::GetSelectMenuText() const ...@@ -628,7 +628,9 @@ wxString SCH_TEXT::GetSelectMenuText() const
tmp.Replace( wxT( "\t" ), wxT( " " ) ); tmp.Replace( wxT( "\t" ), wxT( " " ) );
tmp =( tmp.Length() > 15 ) ? tmp.Left( 12 ) + wxT( "..." ) : tmp; 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 ...@@ -859,7 +861,9 @@ wxString SCH_LABEL::GetSelectMenuText() const
{ {
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); 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 ...@@ -1290,7 +1294,9 @@ wxString SCH_GLOBALLABEL::GetSelectMenuText() const
{ {
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); 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 ...@@ -1645,7 +1651,9 @@ wxString SCH_HIERLABEL::GetSelectMenuText() const
{ {
wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); 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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment