Do not translate name in version info

Leave the application name in version info untranslated when
viewed, copied, or used in a bug report.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13298
This commit is contained in:
Gary Kim 2022-12-31 18:39:04 -05:00
parent 62f0843579
commit 8e8a3c7bdc
No known key found for this signature in database
GPG Key ID: 9349B59FB54594AC
13 changed files with 17 additions and 13 deletions

View File

@ -98,7 +98,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME %s" ), aTitle );
m_disable_ray_tracing = false;
m_aboutTitle = _( "KiCad 3D Viewer" );
m_aboutTitle = _HKI( "KiCad 3D Viewer" );
// Give it an icon
wxIcon icon;

View File

@ -89,6 +89,7 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
}
m_titleName = aParent->GetAboutTitle();
m_untranslatedTitleName = aParent->GetUntranslatedAboutTitle();
m_staticTextAppTitle->SetLabel( m_titleName );
m_staticTextCopyright->SetLabel( m_info.GetCopyright() );
m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
@ -126,7 +127,7 @@ void DIALOG_ABOUT::createNotebooks()
createNotebookHtmlPage( m_notebook, _( "About" ), IMAGES::INFORMATION,
m_info.GetDescription() );
wxString version = GetVersionInfoData( m_titleName, true );
wxString version = GetVersionInfoData( m_untranslatedTitleName, true );
createNotebookHtmlPage( m_notebook, _( "Version" ), IMAGES::VERSION, version, true );
@ -464,7 +465,7 @@ void DIALOG_ABOUT::onCopyVersionInfo( wxCommandEvent& event )
return;
}
wxString msg_version = GetVersionInfoData( m_titleName );
wxString msg_version = GetVersionInfoData( m_untranslatedTitleName );
wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
wxTheClipboard->Flush(); // Allow clipboard data to be available after KiCad closes

View File

@ -55,6 +55,7 @@ class DIALOG_ABOUT : public DIALOG_ABOUT_BASE
private:
wxImageList* m_images;
wxString m_titleName;
wxString m_untranslatedTitleName;
ABOUT_APP_INFO& m_info;

View File

@ -287,7 +287,7 @@ int COMMON_CONTROL::ReportBug( const TOOL_EVENT& aEvent )
if( WarnUserIfOperatingSystemUnsupported() )
return 0;
wxString version = GetVersionInfoData( m_frame->GetAboutTitle(), false, true );
wxString version = GetVersionInfoData( m_frame->GetUntranslatedAboutTitle(), false, true );
wxString message;
message.Printf( m_bugReportTemplate, version );

View File

@ -123,7 +123,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_showBorderAndTitleBlock = true; // true to show sheet references
m_supportsAutoSave = true;
m_syncingPcbToSchSelection = false;
m_aboutTitle = _( "KiCad Schematic Editor" );
m_aboutTitle = _HKI( "KiCad Schematic Editor" );
m_findReplaceDialog = nullptr;

View File

@ -111,7 +111,7 @@ SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_libMgr = nullptr;
m_unit = 1;
m_convert = 1;
m_aboutTitle = _( "KiCad Symbol Editor" );
m_aboutTitle = _HKI( "KiCad Symbol Editor" );
wxIcon icon;
wxIconBundle icon_bundle;

View File

@ -117,7 +117,7 @@ SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAM
if( aFrameType == FRAME_SCH_VIEWER_MODAL )
SetModal( true );
m_aboutTitle = _( "KiCad Symbol Library Viewer" );
m_aboutTitle = _HKI( "KiCad Symbol Library Viewer" );
// Force the frame name used in config. the lib viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),

View File

@ -83,7 +83,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent )
m_apertText = nullptr;
m_dcodeText = nullptr;
m_displayMode = 0;
m_aboutTitle = _( "KiCad Gerber Viewer" );
m_aboutTitle = _HKI( "KiCad Gerber Viewer" );
SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
// some methods in code and avoid link errors

View File

@ -503,7 +503,9 @@ public:
*/
virtual void ProjectChanged() {}
const wxString& GetAboutTitle() const { return m_aboutTitle; }
const wxString& GetAboutTitle() const { return wxGetTranslation( m_aboutTitle ); }
const wxString& GetUntranslatedAboutTitle() const { return m_aboutTitle; }
/**
* Get if the contents of the frame have been modified since the last save.

View File

@ -95,7 +95,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_showBorderAndTitleBlock = true; // true for reference drawings.
DS_DATA_MODEL::GetTheInstance().m_EditMode = true;
m_aboutTitle = _( "KiCad Drawing Sheet Editor" );
m_aboutTitle = _HKI( "KiCad Drawing Sheet Editor" );
// Give an icon
wxIcon icon;

View File

@ -111,7 +111,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_show_layer_manager_tools( true )
{
m_showBorderAndTitleBlock = false; // true to show the frame references
m_aboutTitle = _( "KiCad Footprint Editor" );
m_aboutTitle = _HKI( "KiCad Footprint Editor" );
m_selLayerBox = nullptr;
m_editorSettings = nullptr;

View File

@ -124,7 +124,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
if( aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL )
SetModal( true );
m_aboutTitle = _( "KiCad Footprint Library Viewer" );
m_aboutTitle = _HKI( "KiCad Footprint Library Viewer" );
// Force the items to always snap
m_magneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;

View File

@ -199,7 +199,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// assume dirty
m_ZoneFillsDirty = true;
m_aboutTitle = _( "KiCad PCB Editor" );
m_aboutTitle = _HKI( "KiCad PCB Editor" );
// Must be created before the menus are created.
if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist )