From d1793df1eda463b10107d41785ad1d7f055ed476 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 14:48:12 +0500 Subject: upd: moved the bot part to a relative subfolder --- bot/src/localization/line_id.cpp | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 bot/src/localization/line_id.cpp (limited to 'bot/src/localization/line_id.cpp') diff --git a/bot/src/localization/line_id.cpp b/bot/src/localization/line_id.cpp new file mode 100644 index 0000000..567a3ba --- /dev/null +++ b/bot/src/localization/line_id.cpp @@ -0,0 +1,100 @@ +#include "line_id.hpp" + +#include +#include + +namespace bot { + namespace loc { + std::optional string_to_line_id(const std::string &str) { + if (str == "ping.response") { + return LineId::PingResponse; + } + + else if (str == "msg.owner") { + return LineId::MsgOwner; + } + + else if (str == "argument.subcommand") { + return LineId::ArgumentSubcommand; + } else if (str == "argument.message") { + return LineId::ArgumentMessage; + } else if (str == "argument.interval") { + return LineId::ArgumentInterval; + } else if (str == "argument.name") { + return LineId::ArgumentName; + } else if (str == "argument.target") { + return LineId::ArgumentTarget; + } else if (str == "argument.value") { + return LineId::ArgumentValue; + } else if (str == "argument.amount") { + return LineId::ArgumentAmount; + } + + else if (str == "error.template") { + return LineId::ErrorTemplate; + } else if (str == "error.not_enough_arguments") { + return LineId::ErrorNotEnoughArguments; + } else if (str == "error.incorrect_argument") { + return LineId::ErrorIncorrectArgument; + } else if (str == "error.incompatible_name") { + return LineId::ErrorIncompatibleName; + } else if (str == "error.namesake_creation") { + return LineId::ErrorNamesakeCreation; + } else if (str == "error.not_found") { + return LineId::ErrorNotFound; + } else if (str == "error.something_went_wrong") { + return LineId::ErrorSomethingWentWrong; + } else if (str == "error.insufficient_rights") { + return LineId::ErrorInsufficientRights; + } else if (str == "error.illegal_command") { + return LineId::ErrorIllegalCommand; + } + + else if (str == "event.on") { + return LineId::EventOn; + } else if (str == "event.off") { + return LineId::EventOff; + } + + else if (str == "notify.sub") { + return LineId::NotifySub; + } else if (str == "notify.unsub") { + return LineId::NotifyUnsub; + } + + else if (str == "join.response") { + return LineId::JoinResponse; + } else if (str == "join.response_in_chat") { + return LineId::JoinResponseInChat; + } else if (str == "join.already_in") { + return LineId::JoinAlreadyIn; + } else if (str == "join.rejoined") { + return LineId::JoinRejoined; + } else if (str == "join.from_other_chat") { + return LineId::JoinFromOtherChat; + } else if (str == "join.not_allowed") { + return LineId::JoinNotAllowed; + } + + else if (str == "custom_command.new") { + return LineId::CustomcommandNew; + } else if (str == "custom_command.delete") { + return LineId::CustomcommandDelete; + } + + else if (str == "timer.new") { + return LineId::TimerNew; + } else if (str == "timer.delete") { + return LineId::TimerDelete; + } + + else if (str == "help.response") { + return LineId::HelpResponse; + } + + else { + return std::nullopt; + } + } + } +} -- cgit v1.2.3