sigui: fix translatable strings.

Debug strings don't need to be translated.
remotes/push_mirror/vc9-vt-dnd
Török Edvin 15 years ago
parent 694a63841d
commit 10e6bee7b8
  1. 4
      win32/clamav-for-windows/sigui/SigUI/ConfigEditor.cpp
  2. 22
      win32/clamav-for-windows/sigui/SigUI/SigUIMain.cpp
  3. 38
      win32/clamav-for-windows/sigui/SigUI/installdb.cpp
  4. 24
      win32/clamav-for-windows/sigui/SigUI/proxydet.cpp

@ -37,7 +37,7 @@ ConfigEditor::ConfigEditor(const wxString& filename)
#if wxUSE_LOG #if wxUSE_LOG
wxLog::FlushActive(); wxLog::FlushActive();
#endif #endif
wxLogFatalError("Can't create file %s", filename); wxLogFatalError(_("Can't create configuration file %s"), filename);
} }
file.AddLine("DatabaseMirror db.local.win.clamav.net"); file.AddLine("DatabaseMirror db.local.win.clamav.net");
file.AddLine("DNSDatabaseInfo current.cvd.win.clamav.net"); file.AddLine("DNSDatabaseInfo current.cvd.win.clamav.net");
@ -49,7 +49,7 @@ ConfigEditor::ConfigEditor(const wxString& filename)
#if wxUSE_LOG #if wxUSE_LOG
wxLog::FlushActive(); wxLog::FlushActive();
#endif #endif
wxLogFatalError("Can't open existing file %s", filename); wxLogFatalError(_("Can't open existing configuration file %s"), filename);
} }
} }
} }

@ -106,12 +106,12 @@ void SigUIFrame::OnClose(wxCloseEvent& event)
{ {
if (event.CanVeto()) { if (event.CanVeto()) {
if (!Validate() || !TransferDataFromWindow()) { if (!Validate() || !TransferDataFromWindow()) {
wxLogWarning(_("Validation failed")); wxLogWarning(_("Invalid data entered"));
event.Veto(); event.Veto();
return; return;
} }
if (!m_sig_candidates->IsEmpty()) { if (!m_sig_candidates->IsEmpty()) {
int answer = wxMessageBox(_("You have added new signatures that have not been installed yet\n" int answer = wxMessageBox(_("You have added new virus signatures that have not been installed yet\n"
"Are you sure you want to exit?"), "Are you sure you want to exit?"),
_("There are new signatures"), _("There are new signatures"),
wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this); wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this);
@ -199,7 +199,7 @@ class URLValidator : public wxTextValidator
if (uri.GetScheme() == "file") { if (uri.GetScheme() == "file") {
if (!wxFileName::FileExists(uri.GetPath())) if (!wxFileName::FileExists(uri.GetPath()))
return _("file doesn't exist: %s"); return _("File doesn't exist: %s");
return ""; return "";
} }
if (uri.GetScheme() == "http" && uri.IsReference()) if (uri.GetScheme() == "http" && uri.IsReference())
@ -211,7 +211,7 @@ class URLValidator : public wxTextValidator
if (!uri.HasPath()) if (!uri.HasPath())
return _("URL must specify a path: %s"); return _("URL must specify a path: %s");
if (!SigUICopy::validate_dbname(uri.GetPath(), false)) if (!SigUICopy::validate_dbname(uri.GetPath(), false))
return _("Extension is not a valid virus signature database extension: %s"); return _("The extension is not a valid virus signature database extension: %s");
return ""; return "";
} }
public: public:
@ -306,7 +306,7 @@ void SigUIFrame::GetFreshclamDBnames(StringSet *set)
void SigUIFrame::m_custom_addOnButtonClick( wxCommandEvent& WXUNUSED(event) ) void SigUIFrame::m_custom_addOnButtonClick( wxCommandEvent& WXUNUSED(event) )
{ {
URLEntryDialog dlg(this, "Custom virus signatures source HTTP or file URL:", "Input http:// file:// URL or UNC path:"); URLEntryDialog dlg(this, _("Custom virus signatures source HTTP or file URL:"), _("Input http:// file:// URL or UNC path:"));
if (dlg.ShowModal() == wxID_OK) { if (dlg.ShowModal() == wxID_OK) {
wxString str = dlg.GetValue(); wxString str = dlg.GetValue();
if (str.StartsWith("\\\\")) { if (str.StartsWith("\\\\")) {
@ -372,7 +372,7 @@ void SigUIApp::OnEventLoopExit(wxEventLoopBase *WXUNUSED(loop))
void SigUIFrame::m_save_settingsOnButtonClick( wxCommandEvent& WXUNUSED(event) ) void SigUIFrame::m_save_settingsOnButtonClick( wxCommandEvent& WXUNUSED(event) )
{ {
if (!Validate() || !TransferDataFromWindow()) { if (!Validate() || !TransferDataFromWindow()) {
wxLogWarning(_("Validation failed")); wxLogWarning(_("Data entered is invalid"));
return; return;
} }
editor->Save(); editor->Save();
@ -506,7 +506,7 @@ void SigUIFrame::show_db(bool first)
icon->SetIcon(GetIcon()); icon->SetIcon(GetIcon());
line = wxString(msg).AfterFirst('\n'); line = wxString(msg).AfterFirst('\n');
#ifdef _WIN32 #ifdef _WIN32
icon->ShowBalloon("ClamAV database reloaded", icon->ShowBalloon("_(ClamAV database reloaded"),
line, wxICON_INFORMATION); line, wxICON_INFORMATION);
#endif #endif
wxFileName filename0(GetExecPath() + "forcerld"); wxFileName filename0(GetExecPath() + "forcerld");
@ -582,7 +582,7 @@ void SigUIFrame::m_run_freshclamOnButtonClick( wxCommandEvent& WXUNUSED(event) )
//wxMessageBox(cmd); //wxMessageBox(cmd);
long pid = wxExecute(cmd, wxEXEC_ASYNC, process); long pid = wxExecute(cmd, wxEXEC_ASYNC, process);
if (!pid) { if (!pid) {
wxLogError("Failed to launch freshclam"); wxLogError(_("Failed to launch freshclam"));
delete process; delete process;
return; return;
} }
@ -592,7 +592,7 @@ void SigUIFrame::m_run_freshclamOnButtonClick( wxCommandEvent& WXUNUSED(event) )
wxInputStream *in = process->GetInputStream(); wxInputStream *in = process->GetInputStream();
if (!in) if (!in)
{ {
wxLogError("Failed to connect to child output"); wxLogError(_("Failed to connect to child process output"));
return; return;
} }
@ -705,7 +705,7 @@ void MyProcessOutput::OnTerminate(wxProcessEvent &event)
m_cancel_process->SetLabel(_("&Close window")); m_cancel_process->SetLabel(_("&Close window"));
wxString msg; wxString msg;
msg << "Freshclam exited with code: " << exit; msg << _("Freshclam exited with code: ") << exit;
m_logoutput->Append(msg); m_logoutput->Append(msg);
} }
@ -742,7 +742,7 @@ void MyProcessOutput::m_cancel_processOnButtonClick( wxCommandEvent& WXUNUSED(ev
void SigUIFrame::m_local_addOnButtonClick( wxCommandEvent& WXUNUSED(event) ) void SigUIFrame::m_local_addOnButtonClick( wxCommandEvent& WXUNUSED(event) )
{ {
//TODO: keep in sync with DBEXT //TODO: keep in sync with DBEXT
wxString wildcard = "ClamAV database files (*.cbc, *.cdb, *.cfg, *.cld, *.cvd, *.db, *.fp, *.ftm, *.gdb, *.hdb, *.hdu, *.idb, *.ldb, *.ldu, *.mdb, *.mdu, *.ndb, *.ndu, *.pdb, *.rmd, *.sdb, *.wdb, *.zmd)|*.cbc;*.cdb;*.cfg;*.cld;*.cvd;*.db;*.fp;*.ftm;*.gdb;*.hdb;*.hdu;*.idb;*.ldb;*.ldu;*.mdb;*.mdu;*.ndb;*.ndu;*.pdb;*.rmd;*.sdb;*.wdb;*.zmd"; wxString wildcard = _("ClamAV database files") + " (*.cbc, *.cdb, *.cfg, *.cld, *.cvd, *.db, *.fp, *.ftm, *.gdb, *.hdb, *.hdu, *.idb, *.ldb, *.ldu, *.mdb, *.mdu, *.ndb, *.ndu, *.pdb, *.rmd, *.sdb, *.wdb, *.zmd)|*.cbc;*.cdb;*.cfg;*.cld;*.cvd;*.db;*.fp;*.ftm;*.gdb;*.hdb;*.hdu;*.idb;*.ldb;*.ldu;*.mdb;*.mdu;*.ndb;*.ndu;*.pdb;*.rmd;*.sdb;*.wdb;*.zmd";
wxFileDialog dlg(this, _("Choose a virus signature file"), wxFileDialog dlg(this, _("Choose a virus signature file"),
wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString,
wildcard, wildcard,

@ -120,8 +120,8 @@ bool SigUICopy::validate_dbname(const wxString &name, bool all)
SigUICopy::SigUICopy() SigUICopy::SigUICopy()
: cnt(0), max(0), progress(new wxProgressDialog( : cnt(0), max(0), progress(new wxProgressDialog(
_("Signature verification and installation"), _("Virus signature database verification and installation"),
_("Preparing"), _("Preparing for installation"),
100, 100,
NULL, NULL,
wxPD_AUTO_HIDE | wxPD_SMOOTH | wxPD_CAN_ABORT | wxPD_AUTO_HIDE | wxPD_SMOOTH | wxPD_CAN_ABORT |
@ -131,7 +131,7 @@ SigUICopy::SigUICopy()
bool SigUICopy::canceled(void) bool SigUICopy::canceled(void)
{ {
if (progress->WasCancelled()) { if (progress->WasCancelled()) {
wxLogMessage(_("User aborted operation")); wxLogMessage(_("Install aborted by user"));
return true; return true;
} }
return false; return false;
@ -168,7 +168,7 @@ bool SigUICopy::installDBs(void)
} }
if (!OK) { if (!OK) {
wxLogError(_("Failed to verify and install databases\n")); wxLogError(_("Failed to verify and install virus signature databases\n"));
} }
progress->Destroy(); progress->Destroy();
return OK; return OK;
@ -268,7 +268,7 @@ int SigUICopy::sigprogress(const char* WXUNUSED(type), const char* WXUNUSED(name
else else
canceled = !p->progress->Update(p->cnt); canceled = !p->progress->Update(p->cnt);
if (canceled) { if (canceled) {
wxLogMessage(_("User aborted")); wxLogMessage(_("Copy aborted by user"));
longjmp(p->env, 1); longjmp(p->env, 1);
} }
@ -297,7 +297,7 @@ bool SigUICopy::loadDB(const wxString& dir)
//TODO: how about filenames that are not convertible to C strings? //TODO: how about filenames that are not convertible to C strings?
//libclamav doesn't support these, should test what happens //libclamav doesn't support these, should test what happens
if (!(engine = libclamav.cl_engine_new())) { if (!(engine = libclamav.cl_engine_new())) {
wxLogError(_("Can't create new engine")); wxLogError(_("Can't create new antivirus engine"));
return false; return false;
} }
@ -313,11 +313,11 @@ bool SigUICopy::loadDB(const wxString& dir)
break; break;
} }
progress->Update(0, _("Loading signatures ...")); progress->Update(0, _("Loading virus signatures ..."));
progress->Fit(); progress->Fit();
if (setjmp(env) == 0) { if (setjmp(env) == 0) {
if ((ret = libclamav.cl_load(dir.mb_str(), engine, &sigs, CL_DB_STDOPT)) != CL_SUCCESS) { if ((ret = libclamav.cl_load(dir.mb_str(), engine, &sigs, CL_DB_STDOPT)) != CL_SUCCESS) {
wxLogError(_("Failed to load signatures: %s\n"), wxLogError(_("Failed to load virus signatures: %s\n"),
libclamav.cl_strerror(ret)); libclamav.cl_strerror(ret));
OK = false; OK = false;
break; break;
@ -327,7 +327,7 @@ bool SigUICopy::loadDB(const wxString& dir)
break; break;
} }
progress->Pulse(_("Compiling signatures ...")); progress->Pulse(_("Compiling virus signatures ..."));
progress->Fit(); progress->Fit();
if (canceled()) { if (canceled()) {
OK = false; OK = false;
@ -335,7 +335,7 @@ bool SigUICopy::loadDB(const wxString& dir)
} }
if ((ret = libclamav.cl_engine_compile(engine)) != CL_SUCCESS) { if ((ret = libclamav.cl_engine_compile(engine)) != CL_SUCCESS) {
wxLogError(_("Failed to compile signatures: %s"), wxLogError(_("Failed to compile virus signatures: %s"),
libclamav.cl_strerror(ret)); libclamav.cl_strerror(ret));
OK = false; OK = false;
break; break;
@ -347,7 +347,7 @@ bool SigUICopy::loadDB(const wxString& dir)
return false; return false;
if (OK) { if (OK) {
progress->Pulse(_("Successfully loaded all signatures")); progress->Pulse(_("Successfully loaded all virus signatures"));
progress->Fit(); progress->Fit();
} }
return OK; return OK;
@ -362,7 +362,7 @@ bool SigUICopy::installDB(const wxString& staging, const wxString &dest)
return false; return false;
} }
progress->Pulse(_("Installing signatures")); progress->Pulse(_("Installing virus signatures"));
progress->Fit(); progress->Fit();
if (canceled()) if (canceled())
return false; return false;
@ -402,7 +402,7 @@ bool SigUICopy::writeFreshclamConf()
wxLogError(_("Cannot create temporary file!")); wxLogError(_("Cannot create temporary file!"));
return false; return false;
} }
wxLogVerbose(_("Reading config file from stdin")); wxLogVerbose(_("Reading configuration file from stdin"));
char buffer[1024]; char buffer[1024];
long n; long n;
@ -413,7 +413,7 @@ bool SigUICopy::writeFreshclamConf()
wxLogError(_("No input provided! Use SigUI -w </path/to/freshclam.conf")); wxLogError(_("No input provided! Use SigUI -w </path/to/freshclam.conf"));
return false; return false;
} }
wxLogError(_("read() failed: %d"), errno); wxLogError(_("read failed: %d"), errno);
return false; return false;
} }
if (n == 0) if (n == 0)
@ -430,19 +430,19 @@ bool SigUICopy::writeFreshclamConf()
cmd << "\"" << GetExecPath() << "freshclam.exe\" -V --config-file=\"" cmd << "\"" << GetExecPath() << "freshclam.exe\" -V --config-file=\""
<< tempname << "\""; << tempname << "\"";
wxLogVerbose(_("Validating config file with freshclam: %s"), tempname); wxLogVerbose(_("Validating configuration file with freshclam: %s"), tempname);
wxArrayString output; wxArrayString output;
wxArrayString errors; wxArrayString errors;
if (wxExecute(cmd, output, errors, wxEXEC_BLOCK) != 0) { if (wxExecute(cmd, output, errors, wxEXEC_BLOCK) != 0) {
wxLogVerbose(_("Config file is not valid: %s"), tempname); wxLogVerbose(_("Configuration file is not valid: %s"), tempname);
for (unsigned i=0;i<errors.GetCount();i++) for (unsigned i=0;i<errors.GetCount();i++)
wxLogError(_("freshclam: %s"), errors[i]); wxLogError("freshclam: %s", errors[i]);
wxLogError(_("Configuration file provided is not valid!")); wxLogError(_("Configuration file provided is not valid!"));
wxRemoveFile(tempname); wxRemoveFile(tempname);
return false; return false;
} }
wxLogVerbose(_("Config file is valid: %s"), tempname); wxLogVerbose(_("Configuration file is valid: %s"), tempname);
wxString conf = GetExecPath() + "freshclam.conf"; wxString conf = GetExecPath() + "freshclam.conf";
@ -451,7 +451,7 @@ bool SigUICopy::writeFreshclamConf()
if (!wxRemoveFile(tempname)) if (!wxRemoveFile(tempname))
return false; return false;
wxLogVerbose(_("Config file updated")); wxLogVerbose(_("Configuration file updated"));
return true; return true;
} }

@ -117,10 +117,10 @@ void SigUIFrame::m_proxy_autodetOnButtonClick( wxCommandEvent& WXUNUSED(event) )
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
wxLogVerbose(_("Starting proxy autodetection")); wxLogVerbose("Starting proxy autodetection");
WHttp whttp; WHttp whttp;
if (!whttp.IsOK()) { if (!whttp.IsOK()) {
wxLogVerbose(_("WinHTTP could not be loaded: %s"), wxSysErrorMsg(wxSysErrorCode())); wxLogError(_("WinHTTP could not be loaded: %s"), wxSysErrorMsg(wxSysErrorCode()));
return; return;
} }
@ -128,20 +128,20 @@ void SigUIFrame::m_proxy_autodetOnButtonClick( wxCommandEvent& WXUNUSED(event) )
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
memset(&autoproxy_opts, 0, sizeof(autoproxy_opts)); memset(&autoproxy_opts, 0, sizeof(autoproxy_opts));
if (whttp.WinHttpGetIEProxyConfigForCurrentUser(&config) == TRUE) { if (whttp.WinHttpGetIEProxyConfigForCurrentUser(&config) == TRUE) {
wxLogVerbose(_("IE proxy: %s"), config.lpszProxy); wxLogVerbose("IE proxy: %s", config.lpszProxy);
if (config.fAutoDetect) { if (config.fAutoDetect) {
wxLogVerbose(_("Autodetect is set")); wxLogVerbose("Autodetect is set");
need_autoproxy = true; need_autoproxy = true;
autoproxy_opts.dwFlags |= 1; autoproxy_opts.dwFlags |= 1;
} }
if (config.lpszAutoConfigUrl) { if (config.lpszAutoConfigUrl) {
need_autoproxy = true; need_autoproxy = true;
wxLogVerbose(_("Autoconfig URL: %s"), config.lpszAutoConfigUrl); wxLogVerbose("Autoconfig URL: %s", config.lpszAutoConfigUrl);
autoproxy_opts.dwFlags |= 2; autoproxy_opts.dwFlags |= 2;
autoproxy_opts.lpszAutoConfigUrl = config.lpszAutoConfigUrl; autoproxy_opts.lpszAutoConfigUrl = config.lpszAutoConfigUrl;
} }
} else { } else {
wxLogVerbose(_("Failed to get IE proxy settings: %s"), wxSysErrorMsg(wxSysErrorCode())); wxLogVerbose("Failed to get IE proxy settings: %s", wxSysErrorMsg(wxSysErrorCode()));
need_autoproxy = true; need_autoproxy = true;
autoproxy_opts.dwFlags |= 1; autoproxy_opts.dwFlags |= 1;
} }
@ -155,28 +155,28 @@ void SigUIFrame::m_proxy_autodetOnButtonClick( wxCommandEvent& WXUNUSED(event) )
HINTERNET h = whttp.WinHttpOpen(L"SigUI",1,NULL,NULL,0); HINTERNET h = whttp.WinHttpOpen(L"SigUI",1,NULL,NULL,0);
if (h) { if (h) {
wxLogVerbose(_("Retrieving proxy settings for URL")); wxLogVerbose("Retrieving proxy settings for URL");
if (whttp.WinHttpGetProxyForUrl(h, if (whttp.WinHttpGetProxyForUrl(h,
L"http://db.local.win.clamav.net", L"http://db.local.win.clamav.net",
&autoproxy_opts, &autoproxy_opts,
&autoproxy_info)) { &autoproxy_info)) {
wxLogVerbose(_("proxy: %s, accesstype: %d"), wxLogVerbose("proxy: %s, accesstype: %d",
autoproxy_info.lpszProxy, autoproxy_info.lpszProxy,
autoproxy_info.dwAccessType); autoproxy_info.dwAccessType);
if (autoproxy_info.dwAccessType == 3) if (autoproxy_info.dwAccessType == 3)
proxy = wxString(autoproxy_info.lpszProxy); proxy = wxString(autoproxy_info.lpszProxy);
} else { } else {
wxLogVerbose(_("Autoconfig failed, falling back to manual IE settings")); wxLogVerbose("Autoconfig failed, falling back to manual IE settings");
proxy = config.lpszProxy; proxy = config.lpszProxy;
} }
whttp.WinHttpCloseHandle(h); whttp.WinHttpCloseHandle(h);
} else { } else {
wxLogVerbose(_("WinHttpOpen failed"), wxSysErrorMsg(wxSysErrorCode())); wxLogVerbose("WinHttpOpen failed", wxSysErrorMsg(wxSysErrorCode()));
} }
} else { } else {
proxy = config.lpszProxy; proxy = config.lpszProxy;
} }
wxLogVerbose(_("Final proxy: %s"), proxy); wxLogVerbose("Final proxy: %s", proxy);
if (proxy.empty()) { if (proxy.empty()) {
m_proxy->SetValue(false); m_proxy->SetValue(false);
@ -197,7 +197,7 @@ void SigUIFrame::m_proxy_autodetOnButtonClick( wxCommandEvent& WXUNUSED(event) )
if (token.StartsWith("http://")) if (token.StartsWith("http://"))
token = token.Mid(7); token = token.Mid(7);
token = "http://" + token; token = "http://" + token;
wxLogVerbose(_("token: %s"), token); wxLogVerbose("token: %s", token);
wxURI uri(token); wxURI uri(token);
m_proxy->SetValue(true); m_proxy->SetValue(true);
m_proxy_server->SetValue(uri.GetServer()); m_proxy_server->SetValue(uri.GetServer());

Loading…
Cancel
Save