From 621327de7159e480b116acfaa33c89a83c2d7355 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 16 Jun 2016 11:40:12 +0300 Subject: [PATCH] Return original message if translation string is empty --- src/Config/Config_Translator.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.30.2