21 return std::unexpected(
Localization system. Loads one JSON file per language; nested objects flatten into dotted keys (categ...
std::string Get(std::string_view key) const
@ Text
Not selectable; a caption or a summary line.
@ Failed
Anything else; the default so a value-initialized Error is never a false success.
static std::string ReadFile(const std::filesystem::path &path)
std::map< std::string, std::string > Tokens
std::expected< T, Error > Result
void SayRaw(std::string_view line) const
Result< Reply > Ok(std::string_view key, Tokens tokens={}) const
std::function< void(const std::string &)> Send
std::string Text(std::string_view key, Tokens tokens={}) const
Result< Reply > Fail(std::string_view key, Tokens tokens={}) const
void Say(std::string_view key, Tokens tokens={}) const
One failure: a code to branch on, text for the log, and an optional translation key.
What a command handler answers with.