From b04ea483a8f0ec8577125a63e4873b5f98e1547d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 22 Oct 2011 20:21:57 +0200 Subject: [PATCH] Make some messages translatable. --- pcbnew/class_drawsegment.cpp | 7 ++++--- pcbnew/class_mire.cpp | 5 +++-- pcbnew/class_pad.cpp | 14 ++++++++------ pcbnew/class_pcb_text.cpp | 11 +++++------ 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 3ac2547903..55d743e406 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -565,9 +565,10 @@ wxString DRAWSEGMENT::GetSelectMenuText() const wxString text; wxString temp; - text << _( "Pcb Graphic" ) << wxT(": ") << ShowShape( (Track_Shapes)m_Shape ) - << wxChar(' ') << _( "Length:" ) << valeur_param( GetLength(), temp ) - << _( " on " ) << GetLayerName(); + text.Printf( _( "Pcb Graphic: %s length: %s on %s" ), + GetChars( ShowShape( (Track_Shapes)m_Shape ) ), + GetChars( valeur_param( GetLength(), temp ) ), + GetChars( GetLayerName() ) ); return text; } diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp index 4c64d92185..a494e757e4 100644 --- a/pcbnew/class_mire.cpp +++ b/pcbnew/class_mire.cpp @@ -11,6 +11,7 @@ #include "pcbcommon.h" #include "colors_selection.h" #include "trigo.h" +#include "macros.h" #include "protos.h" #include "richio.h" @@ -245,8 +246,8 @@ wxString PCB_TARGET::GetSelectMenuText() const valeur_param( m_Size, msg ); - text << _( "Target" ) << _( " on " ) << GetLayerName() << wxT( " " ) << _( "size" ) - << wxT( " " ) << msg; + text.Printf( _( "Target on %s size %s" ), + GetChars( GetLayerName() ), GetChars( msg ) ); return text; } diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index f44c313866..e73408a2fb 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -932,20 +932,22 @@ wxString D_PAD::ShowPadAttr() const wxString D_PAD::GetSelectMenuText() const { wxString text; + wxString padlayers; BOARD * board = GetBoard(); - text << _( "Pad" ) << wxT( " \"" ) << ReturnStringPadName() << wxT( "\" (" ); if ( (m_layerMask & ALL_CU_LAYERS) == ALL_CU_LAYERS ) - text << _("all copper layers"); + padlayers = _("all copper layers"); else if( (m_layerMask & LAYER_BACK ) == LAYER_BACK ) - text << board->GetLayerName(LAYER_N_BACK); + padlayers = board->GetLayerName(LAYER_N_BACK); else if( (m_layerMask & LAYER_FRONT) == LAYER_FRONT ) - text << board->GetLayerName(LAYER_N_FRONT); + padlayers = board->GetLayerName(LAYER_N_FRONT); else - text << _( "???" ); + padlayers = _( "???" ); - text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); + text.Printf( _( "Pad [%s] (%s) of %s" ), + GetChars(ReturnStringPadName() ), GetChars( padlayers ), + GetChars(( (MODULE*) GetParent() )->GetReference() ) ); return text; } diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index 1cc3e6d6e4..2605193d7e 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -328,16 +328,15 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre ) wxString TEXTE_PCB::GetSelectMenuText() const { - wxString text; - - text << _( "Pcb Text" ) << wxT( " " ); + wxString text, shorttxt; if( m_Text.Len() < 12 ) - text << m_Text; + shorttxt << m_Text; else - text += m_Text.Left( 10 ) + wxT( ".." ); + shorttxt += m_Text.Left( 10 ) + wxT( ".." ); - text << _( " on " ) << GetLayerName(); + text.Printf( _( "Pcb Text %s on %s"), + GetChars ( shorttxt ), GetChars( GetLayerName() ) ); return text; }