Update lyx examples to latest file format (for 1.5.0 release)
[lyx.git] / src / Messages.h
blob36ee74a4c72cbbb7b82954ae89ab6440632b0792
1 // -*- C++ -*-
2 /* \file Messages.h
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
9 */
11 #ifndef MESSAGES_H
12 #define MESSAGES_H
14 #include "support/docstring.h"
16 #include <map>
17 #include <string>
19 namespace lyx {
21 ///
22 class Messages {
23 public:
24 /// messages in the language \p l.
25 /// If \p l is empty, the language will be defined by the environment.
26 Messages(std::string const & l = "");
27 ///
28 docstring const get(std::string const & msg) const;
29 private:
30 ///
31 std::string lang_;
32 /// Did we warn about unavailable locale already?
33 mutable bool warned_;
34 ///
35 typedef std::map<std::string, docstring> TranslationCache;
36 /// Internal cache for gettext translated strings.
37 /// This is needed for performance reason within \c updateLabels()
38 /// under Windows.
39 mutable TranslationCache cache_;
42 /// Access to the unique Messages object for the passed \p language.
43 /// Implementation is in LyX.cpp.
44 extern Messages & getMessages(std::string const & language);
45 /// Access to the unique Messages object used for GUI element.
46 /// Implementation is in LyX.cpp.
47 extern Messages & getGuiMessages();
49 } // namespace lyx
51 #endif