annotate 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
rev   line source
ferencd@0 1 #ifndef DICTIONARY_H
ferencd@0 2 #define DICTIONARY_H
ferencd@0 3
ferencd@0 4 #include <string>
ferencd@0 5 #include <map>
ferencd@0 6 #include <vector>
ferencd@0 7
ferencd@0 8 class dictionary
ferencd@0 9 {
ferencd@0 10 public:
ferencd@0 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);
ferencd@0 12 static std::string translate(const std::string& what, const std::string& target_language);
ferencd@0 13
ferencd@0 14 static void add_translation(const std::string& key, const std::string& language, const std::string& translated);
ferencd@0 15
ferencd@0 16 static const std::vector<std::string> supported_languages;
ferencd@0 17
ferencd@0 18 // contains the translations generated from external files (such as recipes)
ferencd@0 19 // the outer key is the identifier of the text that is to be translated (such as: chicken_soup_desc)
ferencd@0 20 // and the internal keys are the languages, mapped to the given translation
ferencd@0 21 static std::map<std::string, std::map<std::string, std::string>> m_inMemoryTranslations;
ferencd@0 22 };
ferencd@0 23
ferencd@0 24 #endif // DICTIONARY_H