X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmessages.h;h=166f4601d01b28d232e64e298d7ddf14d536bbf8;hb=104051c151f7c3b37ca4febdb2bc3878f0d6a9b5;hp=f8ba53dbf0aa015ae08d6e2d7fed1bede9ffe63d;hpb=e416d1aea7ace1e97f9cf7a3185686cce88b30bf;p=lyx.git diff --git a/src/messages.h b/src/messages.h index f8ba53dbf0..166f4601d0 100644 --- a/src/messages.h +++ b/src/messages.h @@ -11,23 +11,39 @@ #ifndef MESSAGES_H #define MESSAGES_H -#include +#include "support/docstring.h" + +#include #include +namespace lyx { + /// class Messages { public: - /// messages in the language defined by the environment - Messages(); - /// messages in the language \p l - Messages(std::string const & l); + /// 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(); - /// - std::string const get(std::string const & msg) const; + docstring const get(std::string const & msg) const; private: - class Pimpl; - boost::scoped_ptr pimpl_; + /// + std::string lang_; + /// + 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