--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: Config_Translator.cpp
+// Created: 31 May 2016
+// Author: Vitaly SMETANNIKOV
+
+#include "Config_Translator.h"
+#include <Config_XMLReader.h>
+
+class Config_TSReader : public Config_XMLReader
+{
+public:
+ Config_TSReader(const std::string& theTSFile) : Config_XMLReader(theTSFile) {}
+
+ const Config_Translator::Translator& translator() const { return myTranslator; }
+
+protected:
+ /// Overloaded method. Defines how to process each node
+ virtual void processNode(xmlNodePtr theNode);
+private:
+ Config_Translator::Translator myTranslator;
+};
+
+void Config_TSReader::processNode(xmlNodePtr theNode)
+{
+}
+
+
+bool Config_Translator::load(const std::string& theFileName)
+{
+ Config_TSReader aReader(theFileName);
+ aReader.readAll();
+
+ const Translator& aTranslator = aReader.translator();
+ Translator::const_iterator aIt;
+ for (aIt = aTranslator.cbegin(); aIt != aTranslator.cend(); aIt++) {
+ }
+
+ return true;
+}
+
+std::string Config_Translator::translate(const Events_InfoMessage& theInfo)
+{
+ return "";
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: Config_Translator.h
+// Created: 31 May 2016
+// Author: Vitaly SMETANNIKOV
+
+#ifndef Config_Translator_H
+#define Config_Translator_H
+
+#include "Config_def.h"
+#include <Events_InfoMessage.h>
+
+#include <string>
+#include <map>
+
+class Config_Translator
+{
+public:
+ /// A data type of dictionary <KeyString, ResultString>
+ typedef std::map<std::string, std::string> Dictionary;
+
+ /// A data type of Translator with structure <Context, Dictionary>
+ typedef std::map<std::string, Dictionary> Translator;
+
+ /**
+ * Load translations from TS file
+ * \param theFileName a TS file name with full path
+ */
+ static CONFIG_EXPORT bool load(const std::string& theFileName);
+
+ /**
+ * Returns translation from the given info message.
+ * If transdlation is not exists then it returns a string
+ * from the info data without translation
+ * \param theInfo an info message
+ */
+ static CONFIG_EXPORT std::string translate(const Events_InfoMessage& theInfo);
+
+private:
+ static Translator myTranslator;
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: Events_InfoMessage.hxx
+// Created: 31 May 2016
+// Author: Vitaly SMETANNIKOV
+
+#ifndef Events_InfoMessage_H_
+#define Events_InfoMessage_H_
+
+#include <Events.h>
+#include <Events_Message.h>
+#include <Events_Loop.h>
+
+class EVENTS_EXPORT Events_InfoMessage: public Events_Message
+{
+public:
+ Events_InfoMessage(const void* theSender = 0) :
+ Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
+
+ void setContext(const std::string& theContext) { myContext = theContext; }
+
+ std::string context() const { return myContext; }
+
+ void setMessage(const std::string& theMsg) { myMessage = theMsg; }
+
+ std::string message() const { return myMessage; }
+
+ void addParameter(const std::string& theParam)
+ {
+ myParameters.push_back(theParam);
+ }
+
+ void addParameter(double theParam)
+ {
+ char aBuf[50];
+ int n = sprintf(aBuf, "%g", theParam);
+ std::string aStr(aBuf);
+ myParameters.push_back(aStr);
+ }
+
+ void addParameter(int theParam)
+ {
+ char aBuf[50];
+ int n = sprintf(aBuf, "%d", theParam);
+ std::string aStr(aBuf);
+ myParameters.push_back(aStr);
+ }
+
+ std::list<std::string> parameters() const { return myParameters; }
+
+private:
+
+ /// Context of the messgae
+ std::string myContext;
+
+ /// String of the message
+ std::string myMessage;
+
+ /// Parameters of the message
+ std::list<std::string> myParameters;
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>SketchConstraintVertical</name>
+ <message>
+ <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+ <translation>Line for constraint is not selected.</translation>
+ </message>
+ <message>
+ <source>ModelAPI_StateInvalidArgument</source>
+ <translation>Wrong argument for the constraint</translation>
+ </message>
+</context>
+</TS>