moved current language from RouterContext to ClientContext

This commit is contained in:
orignal 2021-09-04 14:01:57 -04:00
parent bce8469e59
commit e8f4c42bfb
4 changed files with 16 additions and 16 deletions

View file

@ -9,7 +9,7 @@
#ifndef __I18N_H__
#define __I18N_H__
#include "RouterContext.h"
#include "ClientContext.h"
namespace i2p
{
@ -19,19 +19,19 @@ namespace i18n
{
const auto it = i2p::i18n::languages.find(lang);
if (it == i2p::i18n::languages.end()) // fallback
i2p::context.SetLanguage (i2p::i18n::english::GetLocale());
i2p::client::context.SetLanguage (i2p::i18n::english::GetLocale());
else
i2p::context.SetLanguage (it->second.LocaleFunc());
i2p::client::context.SetLanguage (it->second.LocaleFunc());
}
inline std::string translate (const std::string& arg)
{
return i2p::context.GetLanguage ()->GetString (arg);
return i2p::client::context.GetLanguage ()->GetString (arg);
}
inline std::string translate (const std::string& arg, const std::string& arg2, const int& n)
{
return i2p::context.GetLanguage ()->GetPlural (arg, arg2, n);
return i2p::client::context.GetLanguage ()->GetPlural (arg, arg2, n);
}
} // i18n
} // i2p