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.
14 #include "support/docstring.h"
24 /// dummy instantiation: no translation is done
26 /// messages in the language \p l.
27 Messages(std::string const & l);
29 docstring const get(std::string const & msg) const;
30 /// What is the language associated with this translation?
31 std::string language() const;
32 /// Is an (at least partial) translation of language with code \p c available?
33 static bool available(std::string const & c);
35 static void guiLanguage(std::string const & l) { gui_lang_ = l; }
37 static std::string const & guiLanguage() { return gui_lang_; }
40 /// Read the strings from the .mo file. Returns true on success.
45 typedef std::map<std::string, docstring> TranslationMap;
46 TranslationMap trans_map_;
47 /// The language used by the Gui
48 static std::string gui_lang_;
51 /// Access to the unique Messages object for the passed \p language.
52 /// Implementation is in LyX.cpp.
53 extern Messages const & getMessages(std::string const & language);
54 /// Access to the unique Messages object used for GUI element.
55 /// Implementation is in LyX.cpp.
56 extern Messages const & getGuiMessages();
58 /// Remove the context suffix from \p trans
59 extern void cleanTranslation(docstring & trans);