don't translate accelerators in XRC menus
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2d1efe3fec
commit
ee1046d1cf
@ -344,9 +344,9 @@ protected:
|
||||
|
||||
// Gets text from param and does some conversions:
|
||||
// - replaces \n, \r, \t by respective chars (according to C syntax)
|
||||
// - replaces $ by & and $$ by $ (needed for $File => &File because of XML)
|
||||
// - replaces _ by & and __ by _ (needed for _File => &File because of XML)
|
||||
// - calls wxGetTranslations (unless disabled in wxXmlResource)
|
||||
wxString GetText(const wxString& param);
|
||||
wxString GetText(const wxString& param, bool translate = TRUE);
|
||||
|
||||
// Returns the XRCID.
|
||||
int GetID();
|
||||
|
@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
||||
int id = GetID();
|
||||
bool checkable = GetBool(wxT("checkable"));
|
||||
wxString label = GetText(wxT("label"));
|
||||
wxString accel = GetText(wxT("accel"));
|
||||
wxString accel = GetText(wxT("accel"), FALSE);
|
||||
wxString fullLabel = label;
|
||||
if (!accel.IsEmpty())
|
||||
fullLabel << wxT("\t") << accel;
|
||||
|
@ -631,14 +631,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
|
||||
|
||||
|
||||
|
||||
wxString wxXmlResourceHandler::GetText(const wxString& param)
|
||||
wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
|
||||
{
|
||||
wxString str1;
|
||||
wxString str2;
|
||||
const wxChar *dt;
|
||||
wxChar amp_char;
|
||||
|
||||
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||
str1 = wxGetTranslation(GetParamValue(param));
|
||||
else
|
||||
str1 = GetParamValue(param);
|
||||
|
@ -344,9 +344,9 @@ protected:
|
||||
|
||||
// Gets text from param and does some conversions:
|
||||
// - replaces \n, \r, \t by respective chars (according to C syntax)
|
||||
// - replaces $ by & and $$ by $ (needed for $File => &File because of XML)
|
||||
// - replaces _ by & and __ by _ (needed for _File => &File because of XML)
|
||||
// - calls wxGetTranslations (unless disabled in wxXmlResource)
|
||||
wxString GetText(const wxString& param);
|
||||
wxString GetText(const wxString& param, bool translate = TRUE);
|
||||
|
||||
// Returns the XRCID.
|
||||
int GetID();
|
||||
|
@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
||||
int id = GetID();
|
||||
bool checkable = GetBool(wxT("checkable"));
|
||||
wxString label = GetText(wxT("label"));
|
||||
wxString accel = GetText(wxT("accel"));
|
||||
wxString accel = GetText(wxT("accel"), FALSE);
|
||||
wxString fullLabel = label;
|
||||
if (!accel.IsEmpty())
|
||||
fullLabel << wxT("\t") << accel;
|
||||
|
@ -631,14 +631,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
|
||||
|
||||
|
||||
|
||||
wxString wxXmlResourceHandler::GetText(const wxString& param)
|
||||
wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
|
||||
{
|
||||
wxString str1;
|
||||
wxString str2;
|
||||
const wxChar *dt;
|
||||
wxChar amp_char;
|
||||
|
||||
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||
str1 = wxGetTranslation(GetParamValue(param));
|
||||
else
|
||||
str1 = GetParamValue(param);
|
||||
|
Loading…
Reference in New Issue
Block a user