]> git.lyx.org Git - lyx.git/blob - src/gettext.h
typos
[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
19 namespace lyx {
20
21 /*
22  * Native Language Support
23  *
24  * The general idea is that any string that should be translated is handled
25  * as follows:
26  *      _("string")
27  *
28  * Static strings are special, obviously and must be flagged as follows:
29  *      static str = N_("string");
30  *
31  * And wherever they are used:
32  *      _(str)
33  *
34  * Every file where there are strings needs:
35  *      #include "gettext.h"
36  *
37  * Remember to mention each of these files in "po/POFILES.in"
38  *
39  * The main() needs a locale_init() and a gettext_init() in the beginning.
40  */
41
42 /*
43  * General translation notes:
44  *   Commands/options are not translated
45  *   Debug messages are not translated
46  *   Panic/fatal (that should not happen) messages need not be translated
47  */
48
49
50 //#ifdef ENABLE_NLS
51
52 ///
53 docstring const _(std::string const &);
54
55 //#else // ENABLE_NLS
56
57 ///
58 //#  define _(str) (str)
59
60 //#endif
61
62 #  define N_(str) (str)              // for detecting static strings
63
64 /**
65  * Translate \p name if it is possible.
66  * This should be used to translate strings that come from configuration
67  * files like .ui files. These strings could already be in the native
68  * language if they come from a file in the personal directory. */
69 docstring const translateIfPossible(docstring const & name);
70
71 ///
72 void locale_init();
73
74
75 } // namespace lyx
76
77 #endif