From: vsv Date: Thu, 16 Jun 2016 08:40:12 +0000 (+0300) Subject: Return original message if translation string is empty X-Git-Tag: V_2.4.0~103 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=621327de7159e480b116acfaa33c89a83c2d7355;p=modules%2Fshaper.git Return original message if translation string is empty --- diff --git a/src/Config/Config_Translator.cpp b/src/Config/Config_Translator.cpp index 643681be2..1210b2bbc 100644 --- a/src/Config/Config_Translator.cpp +++ b/src/Config/Config_Translator.cpp @@ -11,12 +11,22 @@ #include #include +/** + * \class Config_TSReader + * \ingroup Config + * \brief Class for reading translations from TS files (an XML format). + */ class Config_TSReader : public Config_XMLReader { public: + /// Constructor + /// \param theTSFile name of TS file Config_TSReader(const std::string& theTSFile) : Config_XMLReader(theTSFile) {} + /// Returns content of TS file const Config_Translator::Translator& translator() const { return myTranslator; } + + /// Returns codecs defined in TS files const Config_Translator::Dictionary& codecs() const { return myCodecs; } protected: @@ -131,7 +141,8 @@ std::string Config_Translator::translate(const std::string& theContext, if (theParams.size() > 0) { aTranslation = insertParameters(aTranslation, theParams); } - return aTranslation; + if (aTranslation.size() > 0) + return aTranslation; } } std::string aMsg = theMessage;