3 * \file src/support/gettext.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
16 #include "support/strfwd.h"
22 * Native Language Support
24 * The general idea is that any string that should be translated is handled
28 * Static strings are special, obviously and must be flagged as follows:
29 * static str = N_("string");
31 * And wherever they are used:
34 * Every file where there are strings needs:
35 * #include "support/gettext.h"
37 * Remember to mention each of these files in "po/POFILES.in"
39 * The main() needs a locale_init() and a gettext_init() in the beginning.
41 * The various *_() methods accept only ASCII input, so they must not be used
42 * if the input may come from user supplied files.
43 * translateIfPossible() should be used in that case.
47 * General translation notes:
48 * Commands/options are not translated
49 * Debug messages are not translated
50 * Panic/fatal (that should not happen) messages need not be translated
57 docstring const _(std::string const &);
62 //# define _(str) (str)
66 # define N_(str) (str) // for detecting static strings
69 * Translate \p name to the GUI language if it is possible.
70 * This should be used to translate strings that come from configuration
71 * files like .ui files. These strings could already be in the native
72 * language if they come from a file in the personal directory. */
73 docstring const translateIfPossible(docstring const & name);
75 * Translate \p name to \p language if it is possible.
76 * This should be used to translate strings that come from configuration
77 * files like .ui files. These strings could already be in the native
78 * language if they come from a file in the personal directory. */
79 docstring const translateIfPossible(docstring const & name, std::string const & language);