fixed translatable strings handling in XRC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-03-03 23:25:58 +00:00
parent bd3b7e098d
commit 718cf16095
2 changed files with 18 additions and 20 deletions

View File

@@ -633,19 +633,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate) wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
{ {
wxString str1; wxString str1(GetParamValue(param));
wxString str2; wxString str2;
const wxChar *dt; const wxChar *dt;
wxChar amp_char; wxChar amp_char;
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE) // VS: First version of XRC resources used $ instead of & (which is
str1 = wxGetTranslation(GetParamValue(param)); // illegal in XML), but later I realized that '_' fits this purpose
else // much better (because &File means "File with F underlined").
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").
if (m_resource->CompareVersion(2,3,0,1) < 0) if (m_resource->CompareVersion(2,3,0,1) < 0)
amp_char = wxT('$'); amp_char = wxT('$');
else else
@@ -674,7 +669,11 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
else str2 << *dt; else str2 << *dt;
} }
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
return wxGetTranslation(str2);
else
return str2; return str2;
} }

View File

@@ -633,19 +633,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate) wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
{ {
wxString str1; wxString str1(GetParamValue(param));
wxString str2; wxString str2;
const wxChar *dt; const wxChar *dt;
wxChar amp_char; wxChar amp_char;
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE) // VS: First version of XRC resources used $ instead of & (which is
str1 = wxGetTranslation(GetParamValue(param)); // illegal in XML), but later I realized that '_' fits this purpose
else // much better (because &File means "File with F underlined").
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").
if (m_resource->CompareVersion(2,3,0,1) < 0) if (m_resource->CompareVersion(2,3,0,1) < 0)
amp_char = wxT('$'); amp_char = wxT('$');
else else
@@ -674,7 +669,11 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
else str2 << *dt; else str2 << *dt;
} }
if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
return wxGetTranslation(str2);
else
return str2; return str2;
} }