[i18n] add language changing at runtime in webconsole

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2021-06-27 17:14:45 +03:00
parent 6d2c9e367b
commit 12d6f03dc9
No known key found for this signature in database
GPG key ID: 66F6C87B98EBCFE2
9 changed files with 396 additions and 354 deletions

View file

@ -18,8 +18,11 @@ namespace i2p
{
namespace i18n
{
namespace afrikaans // language
namespace afrikaans // language namespace
{
// language name in lowercase
static std::string language = "afrikaans";
// See for language plural forms here:
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
static int plural (int n) {
@ -65,7 +68,7 @@ namespace afrikaans // language
std::shared_ptr<const i2p::i18n::Locale> GetLocale()
{
return std::make_shared<i2p::i18n::Locale>(strings, plurals, [] (int n)->int { return plural(n); });
return std::make_shared<i2p::i18n::Locale>(language, strings, plurals, [] (int n)->int { return plural(n); });
}
} // language