]> SALOME platform Git repositories - modules/shaper.git/blob - src/Config/Config_Translator.h
Salome HOME
Define Translator
[modules/shaper.git] / src / Config / Config_Translator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Config_Translator.h
4 // Created:     31 May 2016
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef Config_Translator_H
8 #define Config_Translator_H
9
10 #include "Config_def.h"
11 #include <Events_InfoMessage.h>
12
13 #include <string>
14 #include <map>
15
16 class Config_Translator
17 {
18 public:
19   /// A data type of dictionary <KeyString, ResultString>
20   typedef std::map<std::string, std::string> Dictionary;
21
22   /// A data type of Translator with structure <Context, Dictionary>
23   typedef std::map<std::string, Dictionary> Translator;
24
25   /**
26   * Load translations from TS file
27   * \param theFileName a TS file name with full path
28   */
29   static CONFIG_EXPORT bool load(const std::string& theFileName);
30
31   /**
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
36   */
37   static CONFIG_EXPORT std::string translate(const Events_InfoMessage& theInfo);
38
39 private:
40   static Translator myTranslator;
41 };
42
43 #endif