\r\n";
for (auto& it: serverForwards)
{
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
@@ -1087,7 +1098,7 @@ namespace http {
return;
}
}
- // Html5 head start
+ // HTML head start
ShowPageHead (s);
if (req.uri.find("page=") != std::string::npos) {
HandlePage (req, res, s);
@@ -1161,7 +1172,7 @@ namespace http {
ShowLeasesSets(s);
else {
res.code = 400;
- ShowError(s, "Unknown page: " + page);
+ ShowError(s, tr("Unknown page") + ": " + page);
return;
}
}
@@ -1180,7 +1191,7 @@ namespace http {
if (token.empty () || m_Tokens.find (std::stoi (token)) == m_Tokens.end ())
{
- ShowError(s, "Invalid token");
+ ShowError(s, tr("Invalid token"));
return;
}
@@ -1238,18 +1249,18 @@ namespace http {
if (dest)
{
if(dest->DeleteStream (streamID))
- s << "
SUCCESS: Stream closed
\r\n
\r\n";
+ s << "
" << tr("SUCCESS") << ": " << tr("Stream closed") << "
\r\n
\r\n";
else
- s << "
ERROR: Stream not found or already was closed
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("Stream not found or already was closed") << "
\r\n
\r\n";
}
else
- s << "
ERROR: Destination not found
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("Destination not found") << "
\r\n
\r\n";
}
else
- s << "
ERROR: StreamID can be null
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("StreamID can't be null") << "
\r\n
\r\n";
- s << "
Return to destination page\r\n";
- s << "
You will be redirected back in 5 seconds";
+ s << "" << tr("Return to destination page") << "
\r\n";
+ s << "
" << tr("You will be redirected back in 5 seconds") << "";
redirect = "5; url=" + webroot + "?page=local_destination&b32=" + b32;
res.add_header("Refresh", redirect.c_str());
return;
@@ -1260,9 +1271,9 @@ namespace http {
if (limit > 0 && limit <= 65535)
SetMaxNumTransitTunnels (limit);
else {
- s << "ERROR: Transit tunnels count must not exceed 65535\r\n
\r\n
\r\n";
- s << "Back to commands list\r\n
\r\n";
- s << "
You will be redirected back in 5 seconds";
+ s << "" << tr("ERROR") << ": " << tr("Transit tunnels count must not exceed 65535") << "\r\n
\r\n
\r\n";
+ s << "" << tr("Back to commands list") << "\r\n
\r\n";
+ s << "
" << tr("You will be redirected back in 5 seconds") << "";
res.add_header("Refresh", redirect.c_str());
return;
}
@@ -1295,37 +1306,37 @@ namespace http {
auto len = i2p::data::ByteStreamToBase64 (signature, signatureLen, sig, signatureLen*2);
sig[len] = 0;
out << "#!sig=" << sig;
- s << "SUCCESS:
\r\n
\r\n
\r\n";
delete[] signature;
delete[] sig;
}
else
- s << "
ERROR: Domain can't end with .b32.i2p\r\n
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("Domain can't end with .b32.i2p") << "\r\n
\r\n
\r\n";
}
else
- s << "
ERROR: Domain must end with .i2p\r\n
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("Domain must end with .i2p") << "\r\n
\r\n
\r\n";
}
else
- s << "
ERROR: Such destination is not found\r\n
\r\n
\r\n";
+ s << "
" << tr("ERROR") << ": " << tr("Such destination is not found") << "\r\n
\r\n
\r\n";
- s << "
Return to destination page\r\n";
+ s << "
" << tr("Return to destination page") << "\r\n";
return;
}
else
{
res.code = 400;
- ShowError(s, "Unknown command: " + cmd);
+ ShowError(s, tr("Unknown command") + ": " + cmd);
return;
}
- s << "
SUCCESS: Command accepted
\r\n";
- s << "
Back to commands list\r\n";
- s << "
You will be redirected in 5 seconds";
+ s << "" << tr("SUCCESS") << ": " << tr("Command accepted") << "
\r\n";
+ s << "" << tr("Back to commands list") << "
\r\n";
+ s << "
" << tr("You will be redirected in 5 seconds") << "";
res.add_header("Refresh", redirect.c_str());
}
diff --git a/filelist.mk b/filelist.mk
index 7d13fb2f..e2a5d40e 100644
--- a/filelist.mk
+++ b/filelist.mk
@@ -19,4 +19,6 @@ LIB_CLIENT_SRC = $(wildcard $(LIB_CLIENT_SRC_DIR)/*.cpp)
#DAEMON_SRC = \
# HTTPServer.cpp I2PControl.cpp UPnP.cpp Daemon.cpp i2pd.cpp
+LANG_SRC = $(wildcard $(LANG_SRC_DIR)/*.cpp)
+
DAEMON_SRC = $(wildcard $(DAEMON_SRC_DIR)/*.cpp)
diff --git a/i18n/English.cpp b/i18n/English.cpp
new file mode 100644
index 00000000..8664a0f0
--- /dev/null
+++ b/i18n/English.cpp
@@ -0,0 +1,56 @@
+#include