GRUB-1.98 changes
[grub2/jjazz.git] / include / grub / i18n.h
blob0cba547657bfa42a03ea5813855b5f39da89da8e
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009,2010 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_I18N_H
20 #define GRUB_I18N_H 1
22 #include <config.h>
23 #include <grub/symbol.h>
25 extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
27 /* NLS can be disabled through the configure --disable-nls option. */
28 #if ENABLE_NLS
30 # ifdef GRUB_UTIL
32 # include <locale.h>
33 # include <libintl.h>
35 # endif /* GRUB_UTIL */
37 #else /* ! ENABLE_NLS */
39 /* Disabled NLS.
40 The casts to 'const char *' serve the purpose of producing warnings
41 for invalid uses of the value returned from these functions.
42 On pre-ANSI systems without 'const', the config.h file is supposed to
43 contain "#define const". */
44 # ifdef GRUB_UTIL
45 # define gettext(Msgid) ((const char *) (Msgid))
46 # else
47 # define grub_gettext(str) ((const char *) (str))
48 # endif /* GRUB_UTIL */
50 #endif /* ENABLE_NLS */
52 #ifdef GRUB_UTIL
53 # define _(str) gettext(str)
54 #else
55 # define _(str) grub_gettext(str)
56 #endif /* GRUB_UTIL */
58 #define N_(str) str
60 #endif /* GRUB_I18N_H */