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
wxLog::FlushActive();
#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("DNSDatabaseInfo current.cvd.win.clamav.net");
@ -49,7 +49,7 @@ ConfigEditor::ConfigEditor(const wxString& filename)
#if wxUSE_LOG
wxLog::FlushActive();
#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 (!Validate() || !TransferDataFromWindow()) {
wxLogWarning(_("Validation failed"));
wxLogWarning(_("Invalid data entered"));
event.Veto();
return;
}
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?"),
_("There are new signatures"),
wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this);
@ -199,7 +199,7 @@ class URLValidator : public wxTextValidator
if (uri.GetScheme() == "file") {
if (!wxFileName::FileExists(uri.GetPath()))
return _("file doesn't exist: %s");
return _("File doesn't exist: %s");
return "";
}
if (uri.GetScheme() == "http" && uri.IsReference())
@ -211,7 +211,7 @@ class URLValidator : public wxTextValidator
if (!uri.HasPath())
return _("URL must specify a path: %s");
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 "";
}
public:
@ -306,7 +306,7 @@ void SigUIFrame::GetFreshclamDBnames(StringSet *set)
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) {
wxString str = dlg.GetValue();
if (str.StartsWith("\\\\")) {
@ -372,7 +372,7 @@ void SigUIApp::OnEventLoopExit(wxEventLoopBase *WXUNUSED(loop))
void SigUIFrame::m_save_settingsOnButtonClick( wxCommandEvent& WXUNUSED(event) )
{
if (!Validate() || !TransferDataFromWindow()) {
wxLogWarning(_("Validation failed"));
wxLogWarning(_("Data entered is invalid"));
return;
}
editor->Save();
@ -506,7 +506,7 @@ void SigUIFrame::show_db(bool first)
icon->SetIcon(GetIcon());
line = wxString(msg).AfterFirst('\n');
#ifdef _WIN32
icon->ShowBalloon("ClamAV database reloaded",
icon->ShowBalloon("_(ClamAV database reloaded"),
line, wxICON_INFORMATION);
#endif
wxFileName filename0(GetExecPath() + "forcerld");
@ -582,7 +582,7 @@ void SigUIFrame::m_run_freshclamOnButtonClick( wxCommandEvent& WXUNUSED(event) )
//wxMessageBox(cmd);
long pid = wxExecute(cmd, wxEXEC_ASYNC, process);
if (!pid) {
wxLogError("Failed to launch freshclam");
wxLogError(_("Failed to launch freshclam"));
delete process;
return;
}
@ -592,7 +592,7 @@ void SigUIFrame::m_run_freshclamOnButtonClick( wxCommandEvent& WXUNUSED(event) )
wxInputStream *in = process->GetInputStream();
if (!in)
{
wxLogError("Failed to connect to child output");
wxLogError(_("Failed to connect to child process output"));
return;
}
@ -705,7 +705,7 @@ void MyProcessOutput::OnTerminate(wxProcessEvent &event)
m_cancel_process->SetLabel(_("&Close window"));
wxString msg;
msg << "Freshclam exited with code: " << exit;
msg << _("Freshclam exited with code: ") << exit;
m_logoutput->Append(msg);
}
@ -742,7 +742,7 @@ void MyProcessOutput::m_cancel_processOnButtonClick( wxCommandEvent& WXUNUSED(ev
void SigUIFrame::m_local_addOnButtonClick( wxCommandEvent& WXUNUSED(event) )
{
//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"),
wxEmptyString, wxEmptyString,
wildcard,

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

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

Loading…
Cancel
Save