1 /* 2 * GRUB -- GRand Unified Bootloader 3 * Copyright (C) 2009,2010 Free Software Foundation, Inc. 4 * 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. 9 * 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. 14 * 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/>. 17 */ 18 19 #ifndef GRUB_I18N_H 20 #define GRUB_I18N_H 1 21 22 #include <grub/symbol.h> 23 24 extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s); 25 26 /* NLS can be disabled through the configure --disable-nls option. */ 27 #if (defined(ENABLE_NLS) && ENABLE_NLS) 28 29 # ifdef GRUB_UTIL 30 31 # include <locale.h> 32 # include <libintl.h> 33 34 # endif /* GRUB_UTIL */ 35 36 #else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */ 37 38 /* Disabled NLS. 39 The casts to 'const char *' serve the purpose of producing warnings 40 for invalid uses of the value returned from these functions. 41 On pre-ANSI systems without 'const', the config.h file is supposed to 42 contain "#define const". */ 43 # ifdef GRUB_UTIL 44 # define gettext(Msgid) ((const char *) (Msgid)) 45 # else 46 # define grub_gettext(str) ((const char *) (str)) 47 # endif /* GRUB_UTIL */ 48 49 #endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ 50 51 #ifdef GRUB_UTIL 52 # define _(str) gettext(str) 53 #else 54 # define _(str) grub_gettext(str) 55 #endif /* GRUB_UTIL */ 56 57 #define N_(str) str 58 59 #endif /* GRUB_I18N_H */ 60