Support multilang, update code

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2021-05-22 18:29:05 +03:00
parent 0e68fe4a57
commit 80b44fc9a9
No known key found for this signature in database
GPG key ID: 66F6C87B98EBCFE2
10 changed files with 124 additions and 28 deletions

View file

@ -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;