Fix translation issue

We cannot use verb-based substitution in translated strings
This commit is contained in:
Seth Hillbrand 2020-10-30 12:48:22 -07:00
parent 7f58424464
commit 7c94983758
5 changed files with 41 additions and 55 deletions

View File

@ -53,7 +53,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnSize">OnWindowSize</event>
<event name="OnUpdateUI">OnUpdateUI</event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>

View File

@ -65,17 +65,22 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
m_currentFootprint( aFootprint ),
m_updateMode( updateMode )
{
wxString title = updateMode ? _( "Update Footprints from Library" ) : _( "Change Footprints" );
wxString verb = updateMode ? _( "Update" ) : _( "Change" );
wxString reset = updateMode ? _( "Reset" ) : _( "Update" );
wxString label;
SetTitle( title );
if( !updateMode )
{
SetTitle( _( "Change Footprints" ) );
m_matchAll->SetLabel( _( "Change all footprints on board" ) );
m_matchSelected->SetLabel( _( "Change selected footprint" ) );
m_matchSpecifiedRef->SetLabel( _( "Change footprints matching reference designator:" ) );
m_matchSpecifiedValue->SetLabel( _( "Change footprints matching value:" ) );
m_matchSpecifiedID->SetLabel( _( "Change footprints with library id:" ) );
m_resetTextItemLayers->SetLabel( _( "Update text layers and visibilities" ) );
m_resetTextItemEffects->SetLabel( _( "Update text sizes, styles and positions" ) );
m_resetFabricationAttrs->SetLabel( _( "Update fabrications attributes" ) );
m_reset3DModels->SetLabel( _( "Update 3D models" ) );
}
if( m_updateMode )
{
label.Printf( m_matchAll->GetLabel(), verb );
m_matchAll->SetLabel( label );
m_changeSizer->Show( false );
}
else
@ -86,29 +91,18 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
if( m_currentFootprint )
{
label.Printf( m_matchSelected->GetLabel(), verb );
m_matchSelected->SetLabel( label );
m_newID->AppendText( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
}
else
m_upperSizer->FindItem( m_matchSelected )->Show( false );
label.Printf( m_matchSpecifiedRef->GetLabel(), verb );
m_matchSpecifiedRef->SetLabel( label );
// Use ChangeValue() instead of SetValue() so we don't generate events.
if( m_currentFootprint )
m_specifiedRef->ChangeValue( m_currentFootprint->GetReference() );
label.Printf( m_matchSpecifiedValue->GetLabel(), verb );
m_matchSpecifiedValue->SetLabel( label );
if( m_currentFootprint )
m_specifiedValue->ChangeValue( m_currentFootprint->GetValue() );
label.Printf( m_matchSpecifiedID->GetLabel(), verb );
m_matchSpecifiedID->SetLabel( label );
if( m_currentFootprint )
m_specifiedID->ChangeValue( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
@ -137,18 +131,6 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
default: break;
}
label.Printf( m_resetTextItemLayers->GetLabel(), reset );
m_resetTextItemLayers->SetLabel( label );
label.Printf( m_resetTextItemEffects->GetLabel(), reset );
m_resetTextItemEffects->SetLabel( label );
label.Printf( m_resetFabricationAttrs->GetLabel(), reset );
m_resetFabricationAttrs->SetLabel( label );
label.Printf( m_reset3DModels->GetLabel(), reset );
m_reset3DModels->SetLabel( label );
m_removeExtraBox->SetValue( g_removeExtraTextItems[ m_updateMode ? 0 : 1 ] );
m_resetTextItemLayers->SetValue( g_resetTextItemLayers[ m_updateMode ? 0 : 1 ] );
m_resetTextItemEffects->SetValue( g_resetTextItemEffects[ m_updateMode ? 0 : 1 ] );
@ -164,7 +146,12 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
// Ensure m_closeButton (with id = wxID_CANCEL) has the right label
// (to fix automatic renaming of button label )
m_sdbSizerCancel->SetLabel( _( "Close" ) );
m_sdbSizerOK->SetLabel( verb );
if( m_updateMode )
m_sdbSizerOK->SetLabel( _( "Update" ) );
else
m_sdbSizerOK->SetLabel( _( "Change" ) );
m_sdbSizerOK->SetDefault();
// Now all widgets have the size fixed, call FinishDialogSettings

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -21,13 +21,13 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
m_upperSizer->SetFlexibleDirection( wxBOTH );
m_upperSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all footprints on board"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("Update all footprints on board"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALL, 5 );
m_matchSelected = new wxRadioButton( this, wxID_ANY, _("%s selected footprint"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSelected = new wxRadioButton( this, wxID_ANY, _("Update selected footprint"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_matchSelected, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("%s footprints matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("Update footprints matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
m_specifiedRef = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
@ -35,13 +35,13 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND, 5 );
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("%s footprints matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("Update footprints matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALL, 5 );
m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("%s footprints with library id:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("Update footprints with library id:"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
@ -98,16 +98,16 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
m_updateOptionsSizer->Add( m_removeExtraBox, 0, wxBOTTOM|wxRIGHT, 5 );
m_resetTextItemLayers = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s text layers and visibilities"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetTextItemLayers = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset text layers and visibilities"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetTextItemLayers, 0, wxBOTTOM|wxRIGHT, 5 );
m_resetTextItemEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s text sizes, styles and positions"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetTextItemEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset text sizes, styles and positions"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetTextItemEffects, 0, wxBOTTOM|wxRIGHT, 5 );
m_resetFabricationAttrs = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s fabrication attributes"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetFabricationAttrs = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset fabrication attributes"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetFabricationAttrs, 0, wxBOTTOM|wxRIGHT, 5 );
m_reset3DModels = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s 3D models"), wxDefaultPosition, wxDefaultSize, 0 );
m_reset3DModels = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset 3D models"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_reset3DModels, 0, wxBOTTOM|wxRIGHT, 5 );

View File

@ -48,7 +48,7 @@
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">%s</property>
<property name="title">Update Footprints from Library</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
@ -109,7 +109,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s all footprints on board</property>
<property name="label">Update all footprints on board</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -177,7 +177,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s selected footprint</property>
<property name="label">Update selected footprint</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -245,7 +245,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s footprints matching reference designator:</property>
<property name="label">Update footprints matching reference designator:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -382,7 +382,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s footprints matching value:</property>
<property name="label">Update footprints matching value:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -519,7 +519,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s footprints with library id:</property>
<property name="label">Update footprints with library id:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1091,7 +1091,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s text layers and visibilities</property>
<property name="label">Reset text layers and visibilities</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1155,7 +1155,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s text sizes, styles and positions</property>
<property name="label">Reset text sizes, styles and positions</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1219,7 +1219,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s fabrication attributes</property>
<property name="label">Reset fabrication attributes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1283,7 +1283,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s 3D models</property>
<property name="label">Reset 3D models</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -83,7 +83,7 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM
public:
DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("%s"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update Footprints from Library"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXCHANGE_FOOTPRINTS_BASE();
};