1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Config_Translator.h
4 // Created: 31 May 2016
5 // Author: Vitaly SMETANNIKOV
7 #ifndef Config_Translator_H
8 #define Config_Translator_H
10 #include "Config_def.h"
11 #include <Events_InfoMessage.h>
16 class Config_Translator
19 /// A data type of dictionary <KeyString, ResultString>
20 typedef std::map<std::string, std::string> Dictionary;
22 /// A data type of Translator with structure <Context, Dictionary>
23 typedef std::map<std::string, Dictionary> Translator;
26 * Load translations from TS file
27 * \param theFileName a TS file name with full path
29 static CONFIG_EXPORT bool load(const std::string& theFileName);
32 * Returns translation from the given info message.
33 * If transdlation is not exists then it returns a string
34 * from the info data without translation
35 * \param theInfo an info message
37 static CONFIG_EXPORT std::string translate(const Events_InfoMessage& theInfo);
40 static Translator myTranslator;