diff options
| author | ilotterytea <iltsu@alright.party> | 2024-12-14 23:12:22 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-12-14 23:12:22 +0500 |
| commit | 79c39906131bb72780da96ccc6eb43524dec3350 (patch) | |
| tree | 9f8a4e6b3f5d858ad20a3cbaeaec1894f352463a /bot/src/localization/localization.cpp | |
| parent | b96792078a350b02c6d3e650bbe5c42b665bee7e (diff) | |
feat: a method for getting loaded localizations
Diffstat (limited to 'bot/src/localization/localization.cpp')
| -rw-r--r-- | bot/src/localization/localization.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bot/src/localization/localization.cpp b/bot/src/localization/localization.cpp index 2742602..48c6d52 100644 --- a/bot/src/localization/localization.cpp +++ b/bot/src/localization/localization.cpp @@ -3,6 +3,7 @@ #include <algorithm> #include <filesystem> #include <fstream> +#include <iterator> #include <map> #include <nlohmann/json.hpp> #include <optional> @@ -128,5 +129,15 @@ namespace bot { return line; } + + const std::vector<std::string> Localization::get_loaded_localizations() + const { + std::vector<std::string> output; + std::transform(this->localizations.begin(), this->localizations.end(), + std::back_inserter(output), + [](const auto &x) { return x.first; }); + + return output; + } } } |
