Another minor change, but this should almost get us to the point that we
[lyx.git] / src / client / gettext.cpp
blob711c7d1dfad2a7ccf916f9b15fb6fb35be70f735
1 /**
2 * \file src/gettext.cpp
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
7 * \author Jean-Marc Lasgouttes
9 * Full author contact details are available in file CREDITS.
12 #include <config.h>
14 #include "support/gettext.h"
15 #include "Messages.h"
17 using namespace std;
19 namespace lyx {
22 #ifdef HAVE_LOCALE_H
23 # include <locale.h>
24 #endif
27 namespace {
29 Messages & getLyXMessages()
31 static Messages lyx_messages;
33 return lyx_messages;
36 } // anon namespace
39 docstring const _(string const & str)
41 return getLyXMessages().get(str);
45 #ifdef ENABLE_NLS
47 void locale_init()
49 # ifdef HAVE_LC_MESSAGES
50 setlocale(LC_MESSAGES, "");
51 # endif
52 setlocale(LC_CTYPE, "");
53 setlocale(LC_NUMERIC, "C");
56 #else // ENABLE_NLS
58 void locale_init()
60 setlocale(LC_NUMERIC, "C");
63 #endif
66 } // namespace lyx