]> git.lyx.org Git - lyx.git/blob - src/gettext.h
* Painter.h:
[lyx.git] / src / gettext.h
1 // -*- C++ -*-
2 /**
3  * \file src/gettext.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GETTEXT_H
14 #define GETTEXT_H
15
16 #include "support/docstring.h"
17
18 #include <string>
19
20
21 namespace lyx {
22
23 /*
24  * Native Language Support
25  *
26  * The general idea is that any string that should be translated is handled
27  * as follows:
28  *      _("string")
29  *
30  * Static strings are special, obviously and must be flagged as follows:
31  *      static str = N_("string");
32  *
33  * And wherever they are used:
34  *      _(str)
35  *
36  * Every file where there are strings needs:
37  *      #include "gettext.h"
38  *
39  * Remember to mention each of these files in "po/POFILES.in"
40  *
41  * The main() needs a locale_init() and a gettext_init() in the beginning.
42  */
43
44 /*
45  * General translation notes:
46  *   Commands/options are not translated
47  *   Debug messages are not translated
48  *   Panic/fatal (that should not happen) messages need not be translated
49  */
50
51
52 //#ifdef ENABLE_NLS
53
54 ///
55 docstring const _(std::string const &);
56
57 //#else // ENABLE_NLS
58
59 ///
60 //#  define _(str) (str)
61
62 //#endif
63
64 #  define N_(str) (str)              // for detecting static strings
65
66 ///
67 void locale_init();
68
69
70 } // namespace lyx
71
72 #endif