mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
197ca2420b
- getMessages(), getGuiMessages(): new global function definitions * lyx_main.C: implementation of getMessages() and getGuiMessages(). * LyX class: - getMessages(), getGuiMessages(), setGuiLanguage(): new interface for Messages access. * LyX::Singletons class: - messages_: new container for Messages objects. * Buffer::Impl::messages is now a pointer to the singleton defined in lyx_main.C. * gettext.C: _() uses the global getGuiMessages() instead of the local static Messages object. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16673 a592a061-630c-0410-9148-cb99ea01b6c8
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
// -*- C++ -*-
|
|
/* \file messages.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef MESSAGES_H
|
|
#define MESSAGES_H
|
|
|
|
#include "support/docstring.h"
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
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 = "");
|
|
///
|
|
docstring const get(std::string const & msg) const;
|
|
private:
|
|
///
|
|
std::string lang_;
|
|
///
|
|
typedef std::map<std::string, docstring> 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
|