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)
|
2016-11-20 08:09:07 -05:00
|
|
|
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;
|
2016-12-21 11:26:16 -05:00
|
|
|
static std::unordered_map<std::string, Game::LocalizeEntry*> LocalizeMap;
|
|
|
|
static std::unordered_map<std::string, Game::LocalizeEntry*> 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);
|
2016-11-20 08:09:07 -05:00
|
|
|
static void LoadLanguageStrings();
|
|
|
|
static void SELoadLanguageStub();
|
2016-07-11 11:14:58 -04:00
|
|
|
};
|
|
|
|
}
|