From 6cbe2131ab6090eedb770059d36aec9b79404219 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 20 Oct 2020 18:09:00 +0100 Subject: [PATCH] Simplify string processing and ease translation. --- pcbnew/toolbars_pcb_editor.cpp | 17 +++++-------- pcbnew/tools/pcb_inspection_tool.cpp | 38 +++++++++------------------- 2 files changed, 18 insertions(+), 37 deletions(-) diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 22f0e5394c..02ec05e254 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -46,16 +45,12 @@ #include #include #include -#include #include #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) #include #endif -#define SEL_LAYER_HELP _( \ - "Show active layer selections\nand select layer pair for route and place via" ) - /* Data to build the layer pair indicator button */ static std::unique_ptr LayerPairBitmap; @@ -659,15 +654,15 @@ void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool a if( hole > 0 ) { - priStr.Printf( _( "%s / %s" ), ComboBoxUnits( primaryUnit, diam, false ), - ComboBoxUnits( primaryUnit, hole, true ) ); - secStr.Printf( _( "%s / %s" ), ComboBoxUnits( secondaryUnit, diam, false ), - ComboBoxUnits( secondaryUnit, hole, true ) ); + priStr = ComboBoxUnits( primaryUnit, diam, false ) + " / " + + ComboBoxUnits( primaryUnit, hole, true ); + secStr = ComboBoxUnits( secondaryUnit, diam, false ) + " / " + + ComboBoxUnits( secondaryUnit, hole, true ); } else { - priStr.Printf( _( "%s" ), ComboBoxUnits( primaryUnit, diam, true ) ); - secStr.Printf( _( "%s" ), ComboBoxUnits( secondaryUnit, diam, true ) ); + priStr = ComboBoxUnits( primaryUnit, diam, true ); + secStr = ComboBoxUnits( secondaryUnit, diam, true ); } msg.Printf( _( "Via: %s (%s)" ), priStr, secStr ); diff --git a/pcbnew/tools/pcb_inspection_tool.cpp b/pcbnew/tools/pcb_inspection_tool.cpp index f2747c5846..5e51135a70 100644 --- a/pcbnew/tools/pcb_inspection_tool.cpp +++ b/pcbnew/tools/pcb_inspection_tool.cpp @@ -205,9 +205,7 @@ void PCB_INSPECTION_TOOL::reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, { r->Report( "" ); r->Report( _( "Report incomplete: could not compile design rules. " ) - + wxT( "" ) - + _( "Show design rules." ) - + wxT( "" ) ); + + "" + _( "Show design rules." ) + "" ); return; } @@ -296,7 +294,7 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) wxString s = aItem->GetSelectMenuText( r->GetUnits() ); if( auto* cItem = dynamic_cast( aItem ) ) - s += wxString::Format( _( " [netclass %s]" ), cItem->GetNetClassName() ); + s += " " + wxString::Format( _( "[netclass %s]" ), cItem->GetNetClassName() ); return s; }; @@ -305,7 +303,7 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) { r->Report( _( "Silkscreen clearance resolution for:" ) ); - r->Report( wxString::Format( wxT( "
  • %s %s
  • %s
  • %s
" ), + r->Report( wxString::Format( "
  • %s %s
  • %s
  • %s
", _( "Layer" ), m_frame->GetBoard()->GetLayerName( layer ), getItemDescription( a ), @@ -329,7 +327,7 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) { r->Report( _( "Clearance resolution for:" ) ); - r->Report( wxString::Format( wxT( "
  • %s %s
  • %s
  • %s
" ), + r->Report( wxString::Format( "
  • %s %s
  • %s
  • %s
", _( "Layer" ), m_frame->GetBoard()->GetLayerName( layer ), getItemDescription( a ), @@ -408,17 +406,14 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Track Width" ); r->Report( _( "Track width resolution for:" ) ); - r->Report( wxString::Format( _( "
  • %s
" ), - item->GetSelectMenuText( r->GetUnits() ) ) ); + r->Report( "
  • " + item->GetSelectMenuText( r->GetUnits() ) + "
" ); r->Report( "" ); if( compileError ) { r->Report( "" ); r->Report( _( "Report incomplete: could not compile design rules. " ) - + wxT( "" ) - + _( "Show design rules." ) - + wxT( "" ) ); + + "" + _( "Show design rules." ) + "" ); } else { @@ -448,17 +443,14 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Via Diameter" ); r->Report( _( "Via diameter resolution for:" ) ); - r->Report( wxString::Format( _( "
  • %s
" ), - item->GetSelectMenuText( r->GetUnits() ) ) ); + r->Report( "
  • " + item->GetSelectMenuText( r->GetUnits() ) + "
" ); r->Report( "" ); if( compileError ) { r->Report( "" ); r->Report( _( "Report incomplete: could not compile design rules. " ) - + wxT( "" ) - + _( "Show design rules." ) - + wxT( "" ) ); + + "" + _( "Show design rules." ) + "" ); } else { @@ -485,17 +477,14 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) r = m_inspectConstraintsDialog->AddPage( "Via Annular Width" ); r->Report( _( "Via annular width resolution for:" ) ); - r->Report( wxString::Format( _( "
  • %s
" ), - item->GetSelectMenuText( r->GetUnits() ) ) ); + r->Report( "
  • " + item->GetSelectMenuText( r->GetUnits() ) + "
" ); r->Report( "" ); if( compileError ) { r->Report( "" ); r->Report( _( "Report incomplete: could not compile design rules. " ) - + wxT( "" ) - + _( "Show design rules." ) - + wxT( "" ) ); + + "" + _( "Show design rules." ) + "" ); } else { @@ -526,17 +515,14 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Hole Size" ); r->Report( _( "Hole diameter resolution for:" ) ); - r->Report( wxString::Format( _( "
  • %s
" ), - item->GetSelectMenuText( r->GetUnits() ) ) ); + r->Report( "
  • " + item->GetSelectMenuText( r->GetUnits() ) + "
" ); r->Report( "" ); if( compileError ) { r->Report( "" ); r->Report( _( "Report incomplete: could not compile design rules. " ) - + wxT( "" ) - + _( "Show design rules." ) - + wxT( "" ) ); + + "" + _( "Show design rules." ) + "" ); } else {