// 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();
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;
-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);
// 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();
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;
-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);