X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FMessages.h;h=4ba2737cef1518911c99923991a213b80c511b23;hb=e4051a6bd586befbcc3dd92c50225d68e1833c73;hp=12a5b40e800d1146f82bda3a3ce406d42e8f6182;hpb=8085efd83a437796b96a94e90fb04a9eb428dd3a;p=lyx.git diff --git a/src/support/Messages.h b/src/support/Messages.h index 12a5b40e80..4ba2737cef 100644 --- a/src/support/Messages.h +++ b/src/support/Messages.h @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * * Full author contact details are available in file CREDITS. */ @@ -26,16 +26,14 @@ public: Messages(std::string const & l = std::string()); /// docstring const get(std::string const & msg) const; + /// What is the language associated with this translation? + std::string language() const; + /// Is an (at least partial) translation of language with code \p c available? + static bool available(std::string const & c); /// static void init(); - /// - static std::string const & defaultLanguage() { return main_lang_; } private: - /// - static void setDefaultLanguage(); - /// - static std::string main_lang_; /// std::string lang_; /// Did we warn about unavailable locale already? @@ -43,17 +41,20 @@ private: /// typedef std::map TranslationCache; /// Internal cache for gettext translated strings. - /// This is needed for performance reason within \c updateLabels() + /// This is needed for performance reason within \c updateBuffer() /// under Windows. mutable TranslationCache cache_; }; /// Access to the unique Messages object for the passed \p language. /// Implementation is in LyX.cpp. -extern Messages & getMessages(std::string const & language); +extern Messages const & getMessages(std::string const & language); /// Access to the unique Messages object used for GUI element. /// Implementation is in LyX.cpp. -extern Messages & getGuiMessages(); +extern Messages const & getGuiMessages(); + +/// Remove the context suffix from \p trans +extern void cleanTranslation(docstring & trans); } // namespace lyx