6 * Native Language Support
8 * The general idea is that any string that should be translated is handled
12 * Static strings are special, obviously and must be flagged as follows:
13 * static str = N_("string");
15 * And wherever they are used:
18 * Every file where there are strings needs:
19 * #include "gettext.h"
21 * Remember to mention each of these files in "po/POFILES.in"
23 * The main() needs a locale_init() and a gettext_init() in the beginning.
27 * General translation notes:
28 * Commands/options are not translated
29 * Debug messages are not translated
30 * Panic/fatal (that should not happen) messages need not be translated
36 # include <libintl.h> // use the header already in the system *EK*
38 # include <locale.h> // for LC_MESSAGES
41 # include "../intl/libintl.h"
44 # define _(str) gettext(str)
45 # define N_(str) (str) // for detecting static strings
47 # ifdef HAVE_LC_MESSAGES
48 // LC_TIME, LC_CTYPE, even LC_ALL
49 # define locale_init() { setlocale (LC_MESSAGES, ""); setlocale (LC_CTYPE, "");}
51 # define locale_init()
53 # define gettext_init() { bindtextdomain (PACKAGE, lyx_localedir.c_str()); \
54 textdomain (PACKAGE); }
57 # define N_(str) (str)
58 # define locale_init()
59 # define gettext_init()