X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmessages.h;h=166f4601d01b28d232e64e298d7ddf14d536bbf8;hb=104051c151f7c3b37ca4febdb2bc3878f0d6a9b5;hp=459b109c7453e2baae913db1e6c13af82c0952d1;hpb=795e9a7586527296ed037e2a0f1d3a321ba9e7ed;p=lyx.git diff --git a/src/messages.h b/src/messages.h index 459b109c74..166f4601d0 100644 --- a/src/messages.h +++ b/src/messages.h @@ -5,46 +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 = ""); /// - typedef std::messages::catalog catalog; - /// - Messages(string const & l, string const & dir); - /// - ~Messages(); - /// - string const get(string const & msg) const; - /// - string const & lang() const { - return lang_; - } - /// - string const & localedir() const { - return localedir_; - } + docstring const get(std::string const & msg) const; private: /// - string lang_; + std::string lang_; /// - string localedir_; - /// - std::locale loc_gl; - /// - std::messages const & mssg_gl; - /// - catalog cat_gl; + 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