mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Support multilang, update code
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
0e68fe4a57
commit
80b44fc9a9
10 changed files with 124 additions and 28 deletions
|
@ -24,7 +24,7 @@ namespace i2p
|
|||
namespace garlic
|
||||
{
|
||||
class RouterIncomingRatchetSession;
|
||||
}
|
||||
}
|
||||
|
||||
const char ROUTER_INFO[] = "router.info";
|
||||
const char ROUTER_KEYS[] = "router.keys";
|
||||
|
@ -39,7 +39,7 @@ namespace garlic
|
|||
eRouterStatusError = 3,
|
||||
eRouterStatusUnknown = 4,
|
||||
eRouterStatusProxy = 5,
|
||||
eRouterStatusMesh = 6
|
||||
eRouterStatusMesh = 6
|
||||
};
|
||||
|
||||
enum RouterError
|
||||
|
@ -49,7 +49,12 @@ namespace garlic
|
|||
eRouterErrorOffline = 2,
|
||||
eRouterErrorSymmetricNAT = 3
|
||||
};
|
||||
|
||||
|
||||
enum Lang {
|
||||
eEnglish = 0,
|
||||
eRussian
|
||||
};
|
||||
|
||||
class RouterContext: public i2p::garlic::GarlicDestination
|
||||
{
|
||||
private:
|
||||
|
@ -144,6 +149,10 @@ namespace garlic
|
|||
void ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg);
|
||||
void ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg);
|
||||
|
||||
// i18n
|
||||
Lang GetLanguage () const { return m_Language; };
|
||||
void SetLanguage (Lang language);
|
||||
|
||||
protected:
|
||||
|
||||
// implements GarlicDestination
|
||||
|
@ -178,6 +187,9 @@ namespace garlic
|
|||
std::unique_ptr<i2p::crypto::X25519Keys> m_StaticKeys;
|
||||
// for ECIESx25519
|
||||
std::unique_ptr<i2p::crypto::NoiseSymmetricState> m_InitialNoiseState, m_CurrentNoiseState;
|
||||
|
||||
// i18n
|
||||
Lang m_Language;
|
||||
};
|
||||
|
||||
extern RouterContext context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue