X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FMessages.h;h=dd24e1c5fccc29b8fba98c90d9f43d9bc26ead6f;hb=8d640dc77608bedddb5b00982c23665584f52d21;hp=655577c0c784772103ff18fc835a455fd448fbc4;hpb=bd2e7480b17a8fa8bc8ed5ec60eb4f02d75a0f1e;p=lyx.git diff --git a/src/support/Messages.h b/src/support/Messages.h index 655577c0c7..dd24e1c5fc 100644 --- a/src/support/Messages.h +++ b/src/support/Messages.h @@ -21,9 +21,10 @@ namespace lyx { /// class Messages { public: + /// dummy instantiation: no translation is done + Messages() {} /// messages in the language \p l. - /// If \p l is empty, the language will be defined by the environment. - Messages(std::string const & l = std::string()); + Messages(std::string const & l); /// docstring const get(std::string const & msg) const; /// What is the language associated with this translation? @@ -31,17 +32,20 @@ public: /// Is an (at least partial) translation of language with code \p c available? static bool available(std::string const & c); /// - static void init(); + static void guiLanguage(std::string const & l) { gui_lang_ = l; } + /// + static std::string const & guiLanguage() { return gui_lang_; } private: + /// Read the strings from the .mo file. Returns true on success. + bool readMoFile(); /// std::string lang_; /// - typedef std::map TranslationCache; - /// Internal cache for gettext translated strings. - /// This is needed for performance reason within \c updateBuffer() - /// under Windows. - mutable TranslationCache cache_; + typedef std::map TranslationMap; + TranslationMap trans_map_; + /// The language used by the Gui + static std::string gui_lang_; }; /// Access to the unique Messages object for the passed \p language.