i18n.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef I18N_H
00021 #define I18N_H
00022
00023 #include <config.h>
00024
00025
00026
00027
00028 #ifdef HAVE_LOCALE_H
00029 # include <locale.h>
00030 #endif
00031 #ifndef HAVE_SETLOCALE
00032 inline void setlocale(int, const char *)
00033 {
00034 }
00035 #endif
00036
00037 #if ENABLE_NLS
00038 # include <libintl.h>
00039 # include <string.h>
00040 # define _(Text) gettext (Text)
00041 # define W_(Text) transcode (gettext (Text) )
00042 # define N_(Text) Text
00043
00047 #ifdef __GNUG__
00048 __attribute__ ((format_arg(1)))
00049 #endif
00050 inline const char *P_(const char *Text)
00051 {
00052 const char * const translation = gettext(Text);
00053 const char * const stripto = strchr(translation, '|');
00054
00055 if(stripto == NULL)
00056 return translation;
00057 else
00058 return stripto+1;
00059 }
00060
00061 #else
00062 # undef bindtextdomain
00063 # define bindtextdomain(Domain, Directory)
00064 # undef textdomain
00065 # define textdomain(Domain)
00066 # define _(Text) Text
00067 # define N_(Text) Text
00068 inline const char *P_(const char *Text)
00069 {
00070 const char * const stripto = strchr(Text, '|');
00071 return stripto+1;
00072 }
00073 # define gettext(Text) Text
00074 # define dgettext(Domain, Text) Text
00075 #endif
00076
00077
00078 #endif // GLOBALS_H