iw4x-client/src/Components/Modules/Localization.hpp

31 lines
894 B
C++
Raw Normal View History

2016-07-11 11:14:58 -04:00
namespace Components
{
class Localization : public Component
{
public:
Localization();
~Localization();
2016-08-15 10:40:30 -04:00
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() { return "Localization"; };
2016-08-15 10:40:30 -04:00
#endif
2016-07-11 11:14:58 -04:00
static void Set(std::string key, std::string value);
static const char* Get(const char* key);
static void SetTemp(std::string key, std::string value);
static void ClearTemp();
private:
2016-09-08 15:41:01 -04:00
static std::mutex LocalizeMutex;
2016-07-22 06:52:12 -04:00
static Utils::Memory::Allocator MemAllocator;
static std::unordered_map<std::string, Game::LocalizedEntry*> LocalizeMap;
static std::unordered_map<std::string, Game::LocalizedEntry*> TempLocalizeMap;
2016-07-11 11:14:58 -04:00
static Dvar::Var UseLocalization;
static void __stdcall SetStringStub(const char* key, const char* value, bool isEnglish);
static void LoadLanguageStrings();
static void SELoadLanguageStub();
2016-07-11 11:14:58 -04:00
};
}