mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-01 05:02:29 +02:00
Reformat code
This commit is contained in:
parent
3ddb370718
commit
55534ea002
140 changed files with 46068 additions and 48277 deletions
42
i18n/I18N.h
42
i18n/I18N.h
|
@ -11,35 +11,29 @@
|
|||
|
||||
#include "ClientContext.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace i18n
|
||||
{
|
||||
inline void SetLanguage(const std::string &lang)
|
||||
{
|
||||
const auto it = i2p::i18n::languages.find(lang);
|
||||
if (it == i2p::i18n::languages.end()) // fallback
|
||||
i2p::client::context.SetLanguage (i2p::i18n::english::GetLocale());
|
||||
else
|
||||
i2p::client::context.SetLanguage (it->second.LocaleFunc());
|
||||
}
|
||||
namespace i2p {
|
||||
namespace i18n {
|
||||
inline void SetLanguage(const std::string &lang) {
|
||||
const auto it = i2p::i18n::languages.find(lang);
|
||||
if (it == i2p::i18n::languages.end()) // fallback
|
||||
i2p::client::context.SetLanguage(i2p::i18n::english::GetLocale());
|
||||
else
|
||||
i2p::client::context.SetLanguage(it->second.LocaleFunc());
|
||||
}
|
||||
|
||||
inline std::string translate (const std::string& arg)
|
||||
{
|
||||
return i2p::client::context.GetLanguage ()->GetString (arg);
|
||||
}
|
||||
inline std::string translate(const std::string &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::client::context.GetLanguage ()->GetPlural (arg, arg2, n);
|
||||
}
|
||||
} // i18n
|
||||
inline std::string translate(const std::string &arg, const std::string &arg2, const int &n) {
|
||||
return i2p::client::context.GetLanguage()->GetPlural(arg, arg2, n);
|
||||
}
|
||||
} // i18n
|
||||
} // i2p
|
||||
|
||||
template<typename... TArgs>
|
||||
std::string tr (TArgs&&... args)
|
||||
{
|
||||
return i2p::i18n::translate(std::forward<TArgs>(args)...);
|
||||
std::string tr(TArgs &&... args) {
|
||||
return i2p::i18n::translate(std::forward<TArgs>(args)...);
|
||||
}
|
||||
|
||||
#endif // __I18N_H__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue