From d9c068bee7f99c94ed81533ef11c5a4a4ab35528 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 25 Sep 2009 14:32:56 +0000 Subject: [PATCH] Applied part of #9142 (wxMac: Fixes missing translation of "Window" menu name) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/menu.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index b3291353e3..ea2ee830e6 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -780,6 +780,11 @@ void wxMenuBar::MacInstallMenuBar() EnableMenuCommand( NULL , kHICommandQuit ) ; } #endif + wxString strippedHelpMenuTitle = wxStripMenuCodes( wxApp::s_macHelpMenuTitleName ) ; + wxString strippedTranslatedHelpMenuTitle = wxStripMenuCodes( wxString( _("&Help") ) ) ; + + wxString strippedWindowMenuTitle = wxStripMenuCodes( wxT("&Window") /* wxApp::s_macWindowMenuTitleName */ ) ; + wxString strippedTranslatedWindowMenuTitle = wxStripMenuCodes( wxString( _("&Window") ) ) ; wxMenuList::compatibility_iterator menuIter = m_menus.GetFirst(); for (size_t i = 0; i < m_menus.GetCount(); i++, menuIter = menuIter->GetNext()) @@ -787,8 +792,9 @@ void wxMenuBar::MacInstallMenuBar() wxMenuItemList::compatibility_iterator node; wxMenuItem *item; wxMenu* menu = menuIter->GetData() , *subMenu = NULL ; + wxString strippedMenuTitle = wxStripMenuCodes(m_titles[i]); - if ( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName ) + if ( strippedMenuTitle == wxT("?") || strippedMenuTitle == strippedHelpMenuTitle || strippedMenuTitle == strippedTranslatedHelpMenuTitle ) { for (node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext()) { @@ -847,8 +853,7 @@ void wxMenuBar::MacInstallMenuBar() } } } - - else if ( ( m_titles[i] == wxT("Window") || m_titles[i] == wxT("&Window") ) + else if ( (strippedMenuTitle == wxT("Window") || strippedMenuTitle == strippedWindowMenuTitle || strippedMenuTitle == strippedTranslatedWindowMenuTitle ) && GetAutoWindowMenu() ) { if ( MacGetWindowMenuHMenu() == NULL )