1 | #ifndef NVIM_GETTEXT_H |
2 | #define NVIM_GETTEXT_H |
3 | |
4 | #ifdef HAVE_WORKING_LIBINTL |
5 | # include <libintl.h> |
6 | # define _(x) gettext((char *)(x)) |
7 | // XXX do we actually need this? |
8 | # ifdef gettext_noop |
9 | # define N_(x) gettext_noop(x) |
10 | # else |
11 | # define N_(x) x |
12 | # endif |
13 | # define NGETTEXT(x, xs, n) ngettext(x, xs, n) |
14 | // On a Mac, gettext's libintl.h defines "setlocale" to be replaced by |
15 | // "libintl_setlocal" which leads to wrong return values. #9789 |
16 | # if defined(__APPLE__) && defined(setlocale) |
17 | # undef setlocale |
18 | # endif |
19 | #else |
20 | # define _(x) ((char *)(x)) |
21 | # define N_(x) x |
22 | # define NGETTEXT(x, xs, n) ((n) == 1 ? (x) : (xs)) |
23 | # define bindtextdomain(x, y) // empty |
24 | # define bind_textdomain_codeset(x, y) // empty |
25 | # define textdomain(x) // empty |
26 | #endif |
27 | |
28 | #endif // NVIM_GETTEXT_H |
29 | |