From aa7e021bfc80f12b4e316caa54af1d962aaecb37 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 15 Sep 2020 08:35:09 -0700 Subject: [PATCH] Remove translated null strings Also improves translatability by separating clauses --- pcbnew/drc/drc_engine.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 696b40c7b5..38e336bdaf 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -476,26 +476,34 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRulesForItems( DRC_CONSTRAINT_TYPE_T aConstraintI // Last matching rule wins, so process in reverse order for( int ii = (int) ruleset->size() - 1; ii >= 0; --ii ) { + wxString msg; const CONSTRAINT_WITH_CONDITIONS* rcons = ruleset->at( ii ); implicit = rcons->parentRule && rcons->parentRule->m_Implicit; REPORT( "" ) - if( aConstraintId == DRC_CONSTRAINT_TYPE_CLEARANCE ) + if( implicit ) { - int clearance = rcons->constraint.m_Value.Min(); - REPORT( wxString::Format( _( "Checking %s %s; clearance: %s." ), - implicit ? _( "" ) : _( "rule" ), - rcons->parentRule->m_Name, - MessageTextFromValue( UNITS, clearance, true ) ) ) + msg = wxString::Format( _( "Checking %s;" ), + rcons->parentRule->m_Name ); } else { - REPORT( wxString::Format( _( "Checking %s %s." ), - implicit ? _( "" ) : _( "rule" ), - rcons->parentRule->m_Name ) ) + msg = wxString::Format( _( "Checking rule %s;"), + rcons->parentRule->m_Name ); } + if( aConstraintId == DRC_CONSTRAINT_TYPE_CLEARANCE ) + { + int clearance = rcons->constraint.m_Value.Min(); + + msg += " "; + msg += wxString::Format( _( "clearance: %s." ), + MessageTextFromValue( UNITS, clearance, true ) ); + } + + REPORT( msg ); + if( aLayer != UNDEFINED_LAYER && !rcons->layerTest.test( aLayer ) ) { REPORT( wxString::Format( _( "Rule layer \"%s\" not matched." ),