blob: 55b56a0bdd6960067c5df50c5828bc787a89cae5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#pragma once
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
#include "../commands/request.hpp"
#include "line_id.hpp"
namespace bot {
namespace loc {
class Localization {
public:
Localization(const std::string &folder_path);
~Localization() = default;
std::optional<std::string> get_localized_line(
const std::string &locale_id, const LineId &line_id) const;
std::optional<std::string> get_formatted_line(
const std::string &locale_id, const LineId &line_id,
const std::vector<std::string> &args) const;
std::optional<std::string> get_formatted_line(
const command::Request &request, const LineId &line_id,
const std::vector<std::string> &args) const;
const std::vector<std::string> get_loaded_localizations() const;
private:
std::unordered_map<LineId, std::string> load_from_file(
const std::string &file_path);
std::unordered_map<std::string, std::unordered_map<LineId, std::string>>
localizations;
};
}
}
|