mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
moved current language from RouterContext to ClientContext
This commit is contained in:
parent
bce8469e59
commit
e8f4c42bfb
4 changed files with 16 additions and 16 deletions
10
i18n/I18N.h
10
i18n/I18N.h
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue