diff options
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r-- | lib/HttpServ.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index 2c79de7..a4101a7 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -8,6 +8,7 @@ #include "ReadJob.h" #include "CopyJob.h" #include "Task.h" +#include "gettext.h" String endhl = "\r\n", endnl = "\n"; @@ -44,7 +45,7 @@ ProcessRequest::ProcessRequest(Action * ap, const Socket & as, const String & an } String ProcessRequest::GetName() { - return "Processing HTTP request"; + return _("Processing HTTP request"); } int ProcessRequest::Do() throw(GeneralException) { @@ -138,7 +139,7 @@ int ProcessRequest::Do() throw(GeneralException) { if (domain == "/bin") bad = false; if (domain == "/") bad = false; if (bad) { - std::cerr << "Error: bad domain.\n"; + std::cerr << _("Error: bad domain.\n"); } } else { // L'url sans domaine ni fichier est valide. (cela arrive sur certains navigateurs...) @@ -172,11 +173,11 @@ int ProcessRequest::Do() throw(GeneralException) { SendHeads(&b, GetMime(file), String("Accept-Ranges: bytes") + endhl + "Content-Length: " + (unsigned long long int) i->GetSize() + endhl, i->GetModif()); i->SetNonBlock(); a = new CopyJob(i, &s); - std::cerr << "File found, dumping.\n"; + std::cerr << _("File found, dumping.\n"); } catch (IOGeneral e) { ShowError(&b); - std::cerr << "File not found, error showed.\n"; + std::cerr << _("File not found, error showed.\n"); } } } @@ -276,7 +277,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha ssize_t sppos; *s >> t; - std::cerr << "Read Request (1): " << t << std::endl; + std::cerr << _("Read Request (1): ") << t << std::endl; int IPos = t.strchr('?'); @@ -437,13 +438,13 @@ HttpServ::HttpServ(Action * ap, int port, const String & nname) throw (GeneralEx r = Listener.SetLocal("", port); if (!r) { - throw GeneralException("Initialisation of the Mini HTTP-Server failed: can't bind"); + throw GeneralException(_("Initialisation of the Mini HTTP-Server failed: can't bind")); } r = Listener.Listen(); if (!r) { - throw GeneralException("Initialisation of the Mini HTTP-Server failed: can't listen"); + throw GeneralException(_("Initialisation of the Mini HTTP-Server failed: can't listen")); } Listener.SetNonBlock(); |