2021-05-25 22:03:29 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, The PurpleI2P Project
|
|
|
|
*
|
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3
|
|
|
|
*
|
|
|
|
* See full license text in LICENSE file at top of project tree
|
|
|
|
*/
|
|
|
|
|
2021-05-22 18:29:05 +03:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2021-05-25 22:03:29 +03:00
|
|
|
#include <memory>
|
|
|
|
#include "I18N.h"
|
2021-05-22 18:29:05 +03:00
|
|
|
|
2021-05-25 22:03:29 +03:00
|
|
|
// English localization file
|
2021-06-16 00:13:26 +03:00
|
|
|
// This is an example translation file without strings in it.
|
2021-05-22 18:29:05 +03:00
|
|
|
|
2021-05-25 22:03:29 +03:00
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace i18n
|
|
|
|
{
|
2021-06-27 17:14:45 +03:00
|
|
|
namespace english // language namespace
|
2021-05-25 22:03:29 +03:00
|
|
|
{
|
2021-06-27 17:14:45 +03:00
|
|
|
// language name in lowercase
|
|
|
|
static std::string language = "english";
|
|
|
|
|
2021-05-22 18:29:05 +03:00
|
|
|
// See for language plural forms here:
|
|
|
|
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
|
2021-05-25 22:03:29 +03:00
|
|
|
static int plural (int n) {
|
2021-05-22 18:29:05 +03:00
|
|
|
return n != 1 ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static std::map<std::string, std::string> strings
|
|
|
|
{
|
2021-05-25 22:03:29 +03:00
|
|
|
{"", ""},
|
2021-05-22 18:29:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static std::map<std::string, std::vector<std::string>> plurals
|
|
|
|
{
|
2021-05-25 22:03:29 +03:00
|
|
|
{"", {"", ""}},
|
2021-05-22 18:29:05 +03:00
|
|
|
};
|
|
|
|
|
2021-05-25 22:03:29 +03:00
|
|
|
std::shared_ptr<const i2p::i18n::Locale> GetLocale()
|
2021-05-22 18:29:05 +03:00
|
|
|
{
|
2021-06-27 17:14:45 +03:00
|
|
|
return std::make_shared<i2p::i18n::Locale>(language, strings, plurals, [] (int n)->int { return plural(n); });
|
2021-05-22 18:29:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // language
|
|
|
|
} // i18n
|
|
|
|
} // i2p
|