Some fixes for I18N. Mainly do not translate debug messages or strings giving only a print format (like "%d").

This commit is contained in:
jean-pierre charras 2019-04-13 10:12:24 +02:00
parent 203019d959
commit 2529346940
6 changed files with 21 additions and 20 deletions

View File

@ -855,12 +855,12 @@ void CONNECTION_GRAPH::buildConnectionGraph()
if( m_global_label_cache.count( name ) || if( m_global_label_cache.count( name ) ||
( m_local_label_cache.count( std::make_pair( subgraph->m_sheet, local_name ) ) ) ) ( m_local_label_cache.count( std::make_pair( subgraph->m_sheet, local_name ) ) ) )
{ {
auto new_name = wxString::Format( _( "%s%u" ), name, suffix ); auto new_name = wxString::Format( "%s%u", name, suffix );
wxLogTrace( "CONN", "Subgraph %ld default name %s conflicts with a label. Changing to %s.", wxLogTrace( "CONN", "Subgraph %ld default name %s conflicts with a label. Changing to %s.",
subgraph->m_code, name, new_name ); subgraph->m_code, name, new_name );
conn->SetSuffix( wxString::Format( _( "%u" ), suffix ) ); conn->SetSuffix( wxString::Format( "%u", suffix ) );
suffix++; suffix++;
name = new_name; name = new_name;
} }
@ -883,13 +883,13 @@ void CONNECTION_GRAPH::buildConnectionGraph()
if( check_name == name ) if( check_name == name )
{ {
auto new_name = wxString::Format( _( "%s%u" ), name, suffix ); auto new_name = wxString::Format( "%s%u", name, suffix );
wxLogTrace( "CONN", "Subgraph %ld and %ld both have name %s. Changing %ld to %s.", wxLogTrace( "CONN", "Subgraph %ld and %ld both have name %s. Changing %ld to %s.",
subgraph->m_code, candidate->m_code, name, subgraph->m_code, candidate->m_code, name,
candidate->m_code, new_name ); candidate->m_code, new_name );
c_conn->SetSuffix( wxString::Format( _( "%u" ), suffix ) ); c_conn->SetSuffix( wxString::Format( "%u", suffix ) );
candidate->m_dirty = false; candidate->m_dirty = false;
suffix++; suffix++;

View File

@ -329,24 +329,25 @@ void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity ) if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity )
return; return;
// These messages are not flagged as translatable, because they are only debug messges
wxString msg; wxString msg;
AppendInfoToMsgPanel( aList ); AppendInfoToMsgPanel( aList );
msg.Printf( "%d", m_bus_code ); msg.Printf( "%d", m_bus_code );
aList.push_back( MSG_PANEL_ITEM( _( "Bus Code" ), msg, BROWN ) ); aList.push_back( MSG_PANEL_ITEM( "Bus Code", msg, BROWN ) );
msg.Printf( "%d", m_subgraph_code ); msg.Printf( "%d", m_subgraph_code );
aList.push_back( MSG_PANEL_ITEM( _( "Subgraph Code" ), msg, BROWN ) ); aList.push_back( MSG_PANEL_ITEM( "Subgraph Code", msg, BROWN ) );
if( auto driver = Driver() ) if( auto driver = Driver() )
{ {
msg.Printf( "%s at %p", driver->GetSelectMenuText( MILLIMETRES ), driver ); msg.Printf( "%s at %p", driver->GetSelectMenuText( MILLIMETRES ), driver );
aList.push_back( MSG_PANEL_ITEM( _( "Connection Source" ), msg, RED ) ); aList.push_back( MSG_PANEL_ITEM( "Connection Source", msg, RED ) );
} }
msg.Printf( "%s at %p", Parent()->GetSelectMenuText( MILLIMETRES ), Parent() ); msg.Printf( "%s at %p", Parent()->GetSelectMenuText( MILLIMETRES ), Parent() );
aList.push_back( MSG_PANEL_ITEM( _( "Attached To" ), msg, RED ) ); aList.push_back( MSG_PANEL_ITEM( "Attached To", msg, RED ) );
} }

View File

@ -49,13 +49,13 @@ wxString SCH_PIN::GetSelectMenuText( EDA_UNITS_T aUnits ) const
wxString tmp; wxString tmp;
#ifdef DEBUG #ifdef DEBUG
tmp.Printf( _( "SCH_PIN for %s %s" ), tmp.Printf( "SCH_PIN for %s %s",
GetChars( m_comp->GetSelectMenuText( aUnits ) ), m_comp->GetSelectMenuText( aUnits ),
GetChars( m_pin->GetSelectMenuText( aUnits ) ) ); m_pin->GetSelectMenuText( aUnits ) );
#else #else
tmp.Printf( _( "%s %s" ), tmp.Printf( "%s %s",
GetChars( m_comp->GetSelectMenuText( aUnits ) ), m_comp->GetSelectMenuText( aUnits ),
GetChars( m_pin->GetSelectMenuText( aUnits ) ) ); m_pin->GetSelectMenuText( aUnits ) );
#endif #endif
return tmp; return tmp;
@ -72,7 +72,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
if( m_net_name_map.count( aPath ) > 0 ) if( m_net_name_map.count( aPath ) > 0 )
return m_net_name_map.at( aPath ); return m_net_name_map.at( aPath );
wxString name = wxT( "Net-(" ); wxString name = "Net-(";
name << m_comp->GetRef( &aPath ); name << m_comp->GetRef( &aPath );
@ -80,7 +80,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
if( /* adoptTimestamp && */ name.Last() == '?' ) if( /* adoptTimestamp && */ name.Last() == '?' )
name << m_comp->GetTimeStamp(); name << m_comp->GetTimeStamp();
name << _( "-Pad" ) << m_pin->GetNumber() << _( ")" ); name << "-Pad" << m_pin->GetNumber() << ")";
m_net_name_map[ aPath ] = name; m_net_name_map[ aPath ] = name;

View File

@ -647,7 +647,7 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList )
} }
msg.Printf( "%p", this ); msg.Printf( "%p", this );
aList.push_back( MSG_PANEL_ITEM( _( "Object Address" ), msg, RED ) ); aList.push_back( MSG_PANEL_ITEM( "Object Address", msg, RED ) );
#endif #endif
} }

View File

@ -871,7 +871,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE, AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
_( "&Drill Files (.drl)..." ), _( "&Drill Files (.drl)..." ),
_( "Generate excellon2 drill file(s)" ), _( "Generate Excellon drill file(s)" ),
KiBitmap( post_drill_xpm ) ); KiBitmap( post_drill_xpm ) );
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE, AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,

View File

@ -153,8 +153,8 @@ void PCB_EDIT_FRAME::OnUpdateCurvedRatsnest( wxUpdateUIEvent& aEvent )
aEvent.Check( displ_opts->m_DisplayRatsnestLinesCurved ); aEvent.Check( displ_opts->m_DisplayRatsnestLinesCurved );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_CURVED_RATSNEST_LINES, m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_CURVED_RATSNEST_LINES,
!displ_opts->m_DisplayRatsnestLinesCurved ? !displ_opts->m_DisplayRatsnestLinesCurved ?
_( "Show ratlines as curves" ) : _( "Show airwires as curves" ) :
_( "Show ratlines as straight lines" ) ); _( "Show airwires as straight lines" ) );
} }