1 #ifndef UTIL_LINUX_NLS_H 2 #define UTIL_LINUX_NLS_H 3 4 #ifndef LOCALEDIR 5 #define LOCALEDIR "/usr/share/locale" 6 #endif 7 8 #ifdef HAVE_LOCALE_H 9 # include <locale.h> 10 #else 11 # undef setlocale 12 # define setlocale(Category, Locale) /* empty */ 13 struct lconv 14 { 15 char *decimal_point; 16 }; 17 # undef localeconv 18 # define localeconv() NULL 19 #endif 20 21 22 #ifdef ENABLE_NLS 23 # include <libintl.h> 24 /* 25 * For NLS support in the public shared libraries we have to specify text 26 * domain name to be independent on the main program. For this purpose define 27 * UL_TEXTDOMAIN_EXPLICIT before you include nls.h to your shared library code. 28 */ 29 # ifdef UL_TEXTDOMAIN_EXPLICIT 30 # define _(Text) dgettext (UL_TEXTDOMAIN_EXPLICIT, Text) 31 # else 32 # define _(Text) gettext (Text) 33 # endif 34 # ifdef gettext_noop 35 # define N_(String) gettext_noop (String) 36 # else 37 # define N_(String) (String) 38 # endif 39 # define P_(Singular, Plural, n) ngettext (Singular, Plural, n) 40 #else 41 # undef bindtextdomain 42 # define bindtextdomain(Domain, Directory) /* empty */ 43 # undef textdomain 44 # define textdomain(Domain) /* empty */ 45 # define _(Text) (Text) 46 # define N_(Text) (Text) 47 # define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) 48 #endif /* ENABLE_NLS */ 49 50 #ifdef HAVE_LANGINFO_H 51 # include <langinfo.h> 52 #else 53 54 typedef int nl_item; 55 extern char *langinfo_fallback(nl_item item); 56 57 # define nl_langinfo langinfo_fallback 58 59 enum { 60 CODESET = 1, 61 RADIXCHAR, 62 THOUSEP, 63 D_T_FMT, 64 D_FMT, 65 T_FMT, 66 T_FMT_AMPM, 67 AM_STR, 68 PM_STR, 69 70 DAY_1, 71 DAY_2, 72 DAY_3, 73 DAY_4, 74 DAY_5, 75 DAY_6, 76 DAY_7, 77 78 ABDAY_1, 79 ABDAY_2, 80 ABDAY_3, 81 ABDAY_4, 82 ABDAY_5, 83 ABDAY_6, 84 ABDAY_7, 85 86 MON_1, 87 MON_2, 88 MON_3, 89 MON_4, 90 MON_5, 91 MON_6, 92 MON_7, 93 MON_8, 94 MON_9, 95 MON_10, 96 MON_11, 97 MON_12, 98 99 ABMON_1, 100 ABMON_2, 101 ABMON_3, 102 ABMON_4, 103 ABMON_5, 104 ABMON_6, 105 ABMON_7, 106 ABMON_8, 107 ABMON_9, 108 ABMON_10, 109 ABMON_11, 110 ABMON_12, 111 112 ERA_D_FMT, 113 ERA_D_T_FMT, 114 ERA_T_FMT, 115 ALT_DIGITS, 116 CRNCYSTR, 117 YESEXPR, 118 NOEXPR 119 }; 120 121 #endif /* !HAVE_LANGINFO_H */ 122 123 #ifndef HAVE_LANGINFO_ALTMON 124 # define ALTMON_1 MON_1 125 # define ALTMON_2 MON_2 126 # define ALTMON_3 MON_3 127 # define ALTMON_4 MON_4 128 # define ALTMON_5 MON_5 129 # define ALTMON_6 MON_6 130 # define ALTMON_7 MON_7 131 # define ALTMON_8 MON_8 132 # define ALTMON_9 MON_9 133 # define ALTMON_10 MON_10 134 # define ALTMON_11 MON_11 135 # define ALTMON_12 MON_12 136 #endif /* !HAVE_LANGINFO_ALTMON */ 137 138 #ifndef HAVE_LANGINFO_NL_ABALTMON 139 # define _NL_ABALTMON_1 ABMON_1 140 # define _NL_ABALTMON_2 ABMON_2 141 # define _NL_ABALTMON_3 ABMON_3 142 # define _NL_ABALTMON_4 ABMON_4 143 # define _NL_ABALTMON_5 ABMON_5 144 # define _NL_ABALTMON_6 ABMON_6 145 # define _NL_ABALTMON_7 ABMON_7 146 # define _NL_ABALTMON_8 ABMON_8 147 # define _NL_ABALTMON_9 ABMON_9 148 # define _NL_ABALTMON_10 ABMON_10 149 # define _NL_ABALTMON_11 ABMON_11 150 # define _NL_ABALTMON_12 ABMON_12 151 #endif /* !HAVE_LANGINFO_NL_ABALTMON */ 152 153 #endif /* UTIL_LINUX_NLS_H */ 154