2004-09-04 12:13:50 +00:00
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
|
* \file src/gettext.cpp
|
2004-09-04 12:13:50 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-11-29 07:04:28 +00:00
|
|
|
|
#include "support/gettext.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "Messages.h"
|
2004-09-04 12:13:50 +00:00
|
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
|
using namespace std;
|
2004-09-04 12:13:50 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2004-09-04 12:13:50 +00:00
|
|
|
|
#ifdef HAVE_LOCALE_H
|
|
|
|
|
# include <locale.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
Messages & getLyXMessages()
|
|
|
|
|
{
|
|
|
|
|
static Messages lyx_messages;
|
|
|
|
|
|
|
|
|
|
return lyx_messages;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
|
|
|
2006-11-04 18:12:57 +00:00
|
|
|
|
docstring const _(string const & str)
|
2004-09-04 12:13:50 +00:00
|
|
|
|
{
|
|
|
|
|
return getLyXMessages().get(str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_NLS
|
|
|
|
|
|
|
|
|
|
void locale_init()
|
|
|
|
|
{
|
|
|
|
|
# ifdef HAVE_LC_MESSAGES
|
|
|
|
|
setlocale(LC_MESSAGES, "");
|
|
|
|
|
# endif
|
|
|
|
|
setlocale(LC_CTYPE, "");
|
|
|
|
|
setlocale(LC_NUMERIC, "C");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else // ENABLE_NLS
|
|
|
|
|
|
|
|
|
|
void locale_init()
|
|
|
|
|
{
|
|
|
|
|
setlocale(LC_NUMERIC, "C");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|