mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
[i18n] add language changing at runtime in webconsole
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
6d2c9e367b
commit
12d6f03dc9
9 changed files with 396 additions and 354 deletions
13
i18n/I18N.h
13
i18n/I18N.h
|
@ -17,16 +17,11 @@ namespace i18n
|
|||
{
|
||||
inline void SetLanguage(const std::string &lang)
|
||||
{
|
||||
if (!lang.compare("afrikaans"))
|
||||
i2p::context.SetLanguage (i2p::i18n::afrikaans::GetLocale());
|
||||
else if (!lang.compare("russian"))
|
||||
i2p::context.SetLanguage (i2p::i18n::russian::GetLocale());
|
||||
else if (!lang.compare("turkmen"))
|
||||
i2p::context.SetLanguage (i2p::i18n::turkmen::GetLocale());
|
||||
else if (!lang.compare("ukrainian"))
|
||||
i2p::context.SetLanguage (i2p::i18n::ukrainian::GetLocale());
|
||||
else // fallback
|
||||
const auto it = i2p::i18n::languages.find(lang);
|
||||
if (it == i2p::i18n::languages.end()) // fallback
|
||||
i2p::context.SetLanguage (i2p::i18n::english::GetLocale());
|
||||
else
|
||||
i2p::context.SetLanguage (it->second.LocaleFunc());
|
||||
}
|
||||
|
||||
inline std::string translate (const std::string& arg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue