← Back to team overview

kicad-developers team mailing list archive

[PATCH 1/2] Use format string for composed strings

 

Some translations may need this.
---
 eeschema/netlist_object.cpp           | 2 +-
 eeschema/tools/sch_editor_control.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/eeschema/netlist_object.cpp b/eeschema/netlist_object.cpp
index c800401210..a077956eb8 100644
--- a/eeschema/netlist_object.cpp
+++ b/eeschema/netlist_object.cpp
@@ -256,7 +256,7 @@ void NETLIST_OBJECT::ConvertBusToNetListItems( NETLIST_OBJECT_LIST& aNetListItem
         else
         {
             wxCHECK_RET( conn.ParseBusGroup( m_Label, &group_name, bus_contents_vec ),
-                         _( "Failed to parse bus group " ) + m_Label );
+                         wxString::Format( _( "Failed to parse bus group %s" ), m_Label ) );
         }
 
         // For named bus groups, like "USB{DP DM}"
diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp
index 912fc548a8..16d342a05c 100644
--- a/eeschema/tools/sch_editor_control.cpp
+++ b/eeschema/tools/sch_editor_control.cpp
@@ -131,7 +131,7 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
                 if( item->Connection( *g_CurrentSheet ) )
                 {
                     netName = item->Connection( *g_CurrentSheet )->Name();
-                    editFrame->SetStatusText( _( "Highlighted net: " ) + UnescapeString( netName ) );
+                    editFrame->SetStatusText( wxString::Format( _( "Highlighted net: %s" ), UnescapeString( netName ) ) );
                 }
             }
         }
@@ -139,7 +139,7 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
 
     editFrame->SetSelectedNetName( netName );
     editFrame->SendCrossProbeNetName( netName );
-    editFrame->SetStatusText( _( "Selected net: " ) + UnescapeString( netName ) );
+    editFrame->SetStatusText( wxString::Format( _( "Selected net: %s" ), UnescapeString( netName ) ) );
 
     aToolMgr->RunAction( SCH_ACTIONS::highlightNetSelection, true );
 

Follow ups