From 1590e48ec1b508c713d451a8ff25f0ed18dfaaf0 Mon Sep 17 00:00:00 2001
From: Jon Evans <jon@craftyjon.com>
Date: Wed, 21 Dec 2022 18:03:15 -0500
Subject: [PATCH] Use translated strings for property display

---
 common/properties/pg_properties.cpp     | 2 +-
 common/widgets/properties_panel.cpp     | 6 ++++++
 common/widgets/properties_panel.h       | 2 ++
 pcbnew/pcb_edit_frame.cpp               | 1 +
 pcbnew/widgets/pcb_properties_panel.cpp | 2 +-
 5 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/common/properties/pg_properties.cpp b/common/properties/pg_properties.cpp
index 618b2b8bbc..49b9d7c94b 100644
--- a/common/properties/pg_properties.cpp
+++ b/common/properties/pg_properties.cpp
@@ -159,7 +159,7 @@ wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty )
 
     if( ret )
     {
-        ret->SetLabel( aProperty->Name() );
+        ret->SetLabel( wxGetTranslation( aProperty->Name() ) );
         ret->SetName( aProperty->Name() );
         ret->Enable( !aProperty->IsReadOnly() );
         ret->SetHelpString( aProperty->Name() );
diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp
index 1774ff4e20..c2cd20e449 100644
--- a/common/widgets/properties_panel.cpp
+++ b/common/widgets/properties_panel.cpp
@@ -122,6 +122,12 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
 }
 
 
+void PROPERTIES_PANEL::OnLanguageChanged()
+{
+    UpdateData();
+}
+
+
 void PROPERTIES_PANEL::update( const SELECTION& aSelection )
 {
     if( m_skipNextUpdate )
diff --git a/common/widgets/properties_panel.h b/common/widgets/properties_panel.h
index 4741a7c6d8..1a3e643a09 100644
--- a/common/widgets/properties_panel.h
+++ b/common/widgets/properties_panel.h
@@ -65,6 +65,8 @@ public:
     void SetSplitterProportion( float aProportion );
     float SplitterProportion() const { return m_splitter_key_proportion; }
 
+    void OnLanguageChanged();
+
 protected:
     virtual void update( const SELECTION& aSelection );
     virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0;
diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp
index e5661be155..e286aeebcd 100644
--- a/pcbnew/pcb_edit_frame.cpp
+++ b/pcbnew/pcb_edit_frame.cpp
@@ -1438,6 +1438,7 @@ void PCB_EDIT_FRAME::ShowChangedLanguage()
 
     m_appearancePanel->OnLanguageChanged();
     m_selectionFilterPanel->OnLanguageChanged();
+    m_propertiesPanel->OnLanguageChanged();
 
     UpdateTitle();
 }
diff --git a/pcbnew/widgets/pcb_properties_panel.cpp b/pcbnew/widgets/pcb_properties_panel.cpp
index e5874bc8c0..77c39f9297 100644
--- a/pcbnew/widgets/pcb_properties_panel.cpp
+++ b/pcbnew/widgets/pcb_properties_panel.cpp
@@ -98,7 +98,7 @@ wxPGProperty* PCB_PROPERTIES_PANEL::createPGProperty( const PROPERTY_BASE* aProp
                     return m_frame->GetColorSettings()->GetColor( l ).ToColour();
                 } );
 
-        ret->SetLabel( aProperty->Name() );
+        ret->SetLabel( wxGetTranslation( aProperty->Name() ) );
         ret->SetName( aProperty->Name() );
         ret->Enable( !aProperty->IsReadOnly() );
         ret->SetClientData( const_cast<PROPERTY_BASE*>( aProperty ) );