diff --git a/Makefile b/Makefile
index 1fca8ddc..d792360a 100644
--- a/Makefile
+++ b/Makefile
@@ -54,15 +54,15 @@ ifneq (, $(findstring darwin, $(SYS)))
else
include Makefile.osx
endif
+else ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
+ DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32App.cpp Win32/Win32Service.cpp Win32/Win32NetState.cpp
+ include Makefile.mingw
else ifneq (, $(findstring linux, $(SYS))$(findstring gnu, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.linux
else ifneq (, $(findstring freebsd, $(SYS))$(findstring openbsd, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.bsd
-else ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
- DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32App.cpp Win32/Win32Service.cpp Win32/Win32NetState.cpp
- include Makefile.mingw
else # not supported
$(error Not supported platform)
endif
diff --git a/daemon/Daemon.cpp b/daemon/Daemon.cpp
index 7b09feeb..2c120537 100644
--- a/daemon/Daemon.cpp
+++ b/daemon/Daemon.cpp
@@ -298,15 +298,14 @@ namespace util
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
- bool ssu; i2p::config::GetOption("ssu", ssu);
bool checkInReserved; i2p::config::GetOption("reservedrange", checkInReserved);
LogPrint(eLogInfo, "Daemon: Starting Transports");
- if(!ssu) LogPrint(eLogInfo, "Daemon: SSU disabled");
+ if(!ssu2) LogPrint(eLogInfo, "Daemon: SSU2 disabled");
if(!ntcp2) LogPrint(eLogInfo, "Daemon: NTCP2 disabled");
i2p::transport::transports.SetCheckReserved(checkInReserved);
- i2p::transport::transports.Start(ntcp2, ssu, ssu2);
- if (i2p::transport::transports.IsBoundSSU() || i2p::transport::transports.IsBoundSSU2() || i2p::transport::transports.IsBoundNTCP2())
+ i2p::transport::transports.Start(ntcp2, ssu2);
+ if (i2p::transport::transports.IsBoundSSU2() || i2p::transport::transports.IsBoundNTCP2())
LogPrint(eLogInfo, "Daemon: Transports started");
else
{
diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp
index 8d57dedb..77254e61 100644
--- a/daemon/HTTPServer.cpp
+++ b/daemon/HTTPServer.cpp
@@ -311,12 +311,9 @@ namespace http {
s << "
\r\n";
switch (address->transportStyle)
{
- case i2p::data::RouterInfo::eTransportNTCP:
+ case i2p::data::RouterInfo::eTransportNTCP2:
s << "NTCP2";
break;
- case i2p::data::RouterInfo::eTransportSSU:
- s << "SSU";
- break;
case i2p::data::RouterInfo::eTransportSSU2:
s << "SSU2";
break;
@@ -843,46 +840,6 @@ namespace http {
if (!sessions.empty ())
ShowTransportSessions (s, sessions, "NTCP2");
}
- auto ssuServer = i2p::transport::transports.GetSSUServer ();
- if (ssuServer)
- {
- auto sessions = ssuServer->GetSessions ();
- if (!sessions.empty ())
- {
- s << "\r\n \r\n ";
- for (const auto& it: sessions)
- {
- s << " \r\n";
- auto endpoint = it.second->GetRemoteEndpoint ();
- if (it.second->IsOutgoing ()) s << " ⇒ ";
- s << endpoint.address ().to_string () << ":" << endpoint.port ();
- if (!it.second->IsOutgoing ()) s << " ⇒ ";
- s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
- if (it.second->GetRelayTag ())
- s << " [itag:" << it.second->GetRelayTag () << "]";
- s << " \r\n" << std::endl;
- }
- s << " \r\n \r\n";
- }
- auto sessions6 = ssuServer->GetSessionsV6 ();
- if (!sessions6.empty ())
- {
- s << "\r\n \r\n ";
- for (const auto& it: sessions6)
- {
- s << " \r\n";
- auto endpoint = it.second->GetRemoteEndpoint ();
- if (it.second->IsOutgoing ()) s << " ⇒ ";
- s << "[" << endpoint.address ().to_string () << "]:" << endpoint.port ();
- if (!it.second->IsOutgoing ()) s << " ⇒ ";
- s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
- if (it.second->GetRelayTag ())
- s << " [itag:" << it.second->GetRelayTag () << "]";
- s << " \r\n" << std::endl;
- }
- s << " \r\n \r\n";
- }
- }
auto ssu2Server = i2p::transport::transports.GetSSU2Server ();
if (ssu2Server)
{
diff --git a/daemon/UPnP.cpp b/daemon/UPnP.cpp
index 6ea4dc24..e48532b0 100644
--- a/daemon/UPnP.cpp
+++ b/daemon/UPnP.cpp
@@ -248,10 +248,10 @@ namespace transport
{
switch (address->transportStyle)
{
- case i2p::data::RouterInfo::eTransportNTCP:
+ case i2p::data::RouterInfo::eTransportNTCP2:
return "TCP";
break;
- case i2p::data::RouterInfo::eTransportSSU:
+ case i2p::data::RouterInfo::eTransportSSU2:
default:
return "UDP";
}
diff --git a/i18n/I18N.cpp b/i18n/I18N.cpp
new file mode 100644
index 00000000..fe04bcb6
--- /dev/null
+++ b/i18n/I18N.cpp
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2021-2022, The PurpleI2P Project
+*
+* This file is part of Purple i2pd project and licensed under BSD3
+*
+* See full license text in LICENSE file at top of project tree
+*/
+
+#include "ClientContext.h"
+#include "I18N_langs.h"
+#include "I18N.h"
+
+namespace i2p
+{
+namespace i18n
+{
+ void SetLanguage(const std::string &lang)
+ {
+ const auto it = i2p::i18n::languages.find(lang);
+ if (it == i2p::i18n::languages.end()) // fallback
+ i2p::client::context.SetLanguage (i2p::i18n::english::GetLocale());
+ else
+ i2p::client::context.SetLanguage (it->second.LocaleFunc());
+ }
+
+ std::string translate (const std::string& arg)
+ {
+ return i2p::client::context.GetLanguage ()->GetString (arg);
+ }
+
+ std::string translate (const std::string& arg, const std::string& arg2, const int& n)
+ {
+ return i2p::client::context.GetLanguage ()->GetPlural (arg, arg2, n);
+ }
+} // i18n
+} // i2p
diff --git a/i18n/I18N.h b/i18n/I18N.h
index dd804926..27e043b9 100644
--- a/i18n/I18N.h
+++ b/i18n/I18N.h
@@ -9,30 +9,68 @@
#ifndef __I18N_H__
#define __I18N_H__
-#include "ClientContext.h"
+#include
+#include |