comparison templates/dictionary.h @ 0:a4671277546c tip

created the repository for the thymian project
author ferencd
date Tue, 17 Aug 2021 11:19:54 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a4671277546c
1 #ifndef DICTIONARY_H
2 #define DICTIONARY_H
3
4 #include <string>
5 #include <map>
6 #include <vector>
7
8 class dictionary
9 {
10 public:
11 static std::string translate(const std::string& what, const std::string& target_language, bool other_languages_too, std::map<std::string, std::string>& translations);
12 static std::string translate(const std::string& what, const std::string& target_language);
13
14 static void add_translation(const std::string& key, const std::string& language, const std::string& translated);
15
16 static const std::vector<std::string> supported_languages;
17
18 // contains the translations generated from external files (such as recipes)
19 // the outer key is the identifier of the text that is to be translated (such as: chicken_soup_desc)
20 // and the internal keys are the languages, mapped to the given translation
21 static std::map<std::string, std::map<std::string, std::string>> m_inMemoryTranslations;
22 };
23
24 #endif // DICTIONARY_H