diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index 86c25e8d0c..93a0b7f561 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -494,11 +494,16 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults) wxString wxXmlResourceHandler::GetText(const wxString& param) { - wxString str1 = GetParamValue(param); + wxString str1; wxString str2; const wxChar *dt; wxChar amp_char; + if (m_resource->GetUseLocale()) + str1 = wxGetTranslation(GetParamValue(param)); + else + str1 = GetParamValue(param); + // VS: First version of XRC resources used $ instead of & (which is illegal in XML), // but later I realized that '_' fits this purpose much better (because // &File means "File with F underlined"). @@ -529,11 +534,8 @@ wxString wxXmlResourceHandler::GetText(const wxString& param) } else str2 << *dt; } - - if (m_resource->GetUseLocale()) - return wxGetTranslation(str2); - else - return str2; + + return str2; } diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 86c25e8d0c..93a0b7f561 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -494,11 +494,16 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults) wxString wxXmlResourceHandler::GetText(const wxString& param) { - wxString str1 = GetParamValue(param); + wxString str1; wxString str2; const wxChar *dt; wxChar amp_char; + if (m_resource->GetUseLocale()) + str1 = wxGetTranslation(GetParamValue(param)); + else + str1 = GetParamValue(param); + // VS: First version of XRC resources used $ instead of & (which is illegal in XML), // but later I realized that '_' fits this purpose much better (because // &File means "File with F underlined"). @@ -529,11 +534,8 @@ wxString wxXmlResourceHandler::GetText(const wxString& param) } else str2 << *dt; } - - if (m_resource->GetUseLocale()) - return wxGetTranslation(str2); - else - return str2; + + return str2; }