#pragma once #include "Utils/Sigslot.hpp" #include "Utils/fwd.hpp" #include #include #include #include #include #include #include class I18n { public: static void Init(); static void Shutdown(); static Signal<> OnReload; static void ReloadLocales(); static std::string_view GetLanguage(); static bool SetLanguage(std::string_view lang); static std::optional Lookup(std::string_view key); static std::string_view LookupUnwrap(std::string_view key); static std::string_view LookupLanguage(std::string_view lang); }; struct StringArgument { std::string Value; }; struct IntArgument { int Value; }; struct FloatArgument { double Value; }; class BasicTranslation { private: const char* mContent; public: BasicTranslation(std::string_view key); const char* Get() const; }; class FormattedTranslation { public: using Element = std::variant; using Argument = std::string; private: std::vector mParsedElements; size_t mNumArguments; size_t mMinimumResultLen; public: FormattedTranslation(std::string_view key); std::string Format(std::span args); }; class NumericTranslation { public: // TODO };