- MGR: Take two of the above.

clientgui/
        DlgEventLog.cpp
        MainDocument.cpp, .h

svn path=/trunk/boinc/; revision=22499
This commit is contained in:
Rom Walton 2010-10-13 23:00:02 +00:00
parent b6d8290106
commit 79cfbc6fd6
4 changed files with 16 additions and 4 deletions

View File

@ -7275,3 +7275,10 @@ Rom 13 Oct 2010
clientgui/
DlgEventLog.cpp
Rom 13 Oct 2010
- MGR: Take two of the above.
clientgui/
DlgEventLog.cpp
MainDocument.cpp, .h

View File

@ -885,7 +885,7 @@ wxInt32 CDlgEventLog::FormatMessage(wxInt32 item, wxString& strBuffer) const {
if (message) {
strBuffer = wxString(message->body.c_str(), wxConvUTF8);
wxGetApp().GetDocument()->LocalizeNoticeText(strBuffer, true);
wxGetApp().GetDocument()->LocalizeNoticeText(strBuffer, false, true);
}
return 0;

View File

@ -1975,7 +1975,7 @@ int CMainDocument::ResetNoticeState() {
// parse out the _(...)'s, and translate them
//
bool CMainDocument::LocalizeNoticeText(wxString& strMessage, bool bSanitize) {
bool CMainDocument::LocalizeNoticeText(wxString& strMessage, bool bSanitize, bool bClean) {
wxString strBuffer = wxEmptyString;
wxString strStart = wxString(wxT("_(\""));
wxString strEnd = wxString(wxT("\")"));
@ -1983,10 +1983,15 @@ bool CMainDocument::LocalizeNoticeText(wxString& strMessage, bool bSanitize) {
if (bSanitize) {
// Replace CRLFs with HTML breaks.
strMessage.Replace(wxT("\r\n"), wxT("<BR>"));
// Replace LFs with HTML breaks.
strMessage.Replace(wxT("\n"), wxT("<BR>"));
}
if (bClean) {
// Replace CRLFs with HTML breaks.
strMessage.Replace(wxT("\r\n"), wxT(""));
// Replace LFs with HTML breaks.
strMessage.Replace(wxT("\n"), wxT(""));
}
// Localize translatable text
while (strMessage.Find(strStart.c_str()) != wxNOT_FOUND) {

View File

@ -303,7 +303,7 @@ public:
void UpdateUnreadNoticeState();
int ResetNoticeState();
bool LocalizeNoticeText(wxString& strMessage, bool bSanitize = false);
bool LocalizeNoticeText(wxString& strMessage, bool bSanitize = false, bool bClean = false);
//