]> git.lyx.org Git - lyx.git/blob - src/gettext.C
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / gettext.C
1 /**
2  * \file src/gettext.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "gettext.h"
15 #include "messages.h"
16
17
18 #ifdef HAVE_LOCALE_H
19 #  include <locale.h>
20 #endif
21
22 using std::string;
23
24
25 namespace {
26
27 Messages & getLyXMessages()
28 {
29         static Messages lyx_messages;
30
31         return lyx_messages;
32 }
33
34 } // anon namespace
35
36
37 string const _(string const & str)
38 {
39         return getLyXMessages().get(str);
40 }
41
42
43 #ifdef ENABLE_NLS
44
45 void locale_init()
46 {
47 #  ifdef HAVE_LC_MESSAGES
48         setlocale(LC_MESSAGES, "");
49 #  endif
50         setlocale(LC_CTYPE, "");
51         setlocale(LC_NUMERIC, "C");
52 }
53
54 #else // ENABLE_NLS
55
56 void locale_init()
57 {
58         setlocale(LC_NUMERIC, "C");
59 }
60
61 #endif