X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmessages.h;h=166f4601d01b28d232e64e298d7ddf14d536bbf8;hb=b9aa557b359463dfb0a2132b665570c8d1e5d605;hp=2a85f10e1e6e46991fe9b5564bfeb1d075099f96;hpb=e2b65dec0cb141ba517e171deb339001bdba0b3c;p=lyx.git diff --git a/src/messages.h b/src/messages.h index 2a85f10e1e..166f4601d0 100644 --- a/src/messages.h +++ b/src/messages.h @@ -5,30 +5,45 @@ * * \author Lars Gullik Bjønnes * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. */ #ifndef MESSAGES_H #define MESSAGES_H -#include "LString.h" +#include "support/docstring.h" -#include +#include +#include + +namespace lyx { /// class Messages { public: + /// messages in the language \p l. + /// If \p l is empty, the language will be defined by the environment. + Messages(std::string const & l = ""); /// - Messages(); - /// - Messages(string const & l); + docstring const get(std::string const & msg) const; +private: /// - ~Messages(); + std::string lang_; /// - string const get(string const & msg) const; -private: - class Pimpl; - boost::scoped_ptr pimpl_; + typedef std::map TranslationCache; + /// Internal cache for gettext translated strings. + /// This is needed for performance reason within \c updateLabels() + /// under Windows. + mutable TranslationCache cache_; }; +/// Access to the unique Messages object for the passed \p language. +/// Implementation is in lyx_main.C. +extern Messages & getMessages(std::string const & language); +/// Access to the unique Messages object used for GUI element. +/// Implementation is in lyx_main.C. +extern Messages & getGuiMessages(); + +} // namespace lyx + #endif