From: Kurt Zeilenga Date: Sat, 5 Apr 2003 20:49:16 +0000 (+0000) Subject: Basic infrastructure for i18n/l10n X-Git-Tag: AUTOCONF_2_57~57 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4809e4da1efa5ebb086948e44047b10444d18862;p=openldap Basic infrastructure for i18n/l10n --- diff --git a/include/Makefile.in b/include/Makefile.in index 7a846c8f24..969591c487 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -50,6 +50,7 @@ ldap_config.h: $(LDAP_CONFIG) Makefile sbindir=$(sbindir); \ libexecdir=$(libexecdir); \ localstatedir=$(localstatedir); \ + localedir=$(localedir); \ fi; \ $(SED) \ -e "s;%SYSCONFDIR%;$$sysconfdir;" \ @@ -58,6 +59,7 @@ ldap_config.h: $(LDAP_CONFIG) Makefile -e "s;%SBINDIR%;$$sbindir;" \ -e "s;%LIBEXECDIR%;$$libexecdir;" \ -e "s;%RUNDIR%;$$localstatedir;" \ + -e "s;%LOCALEDIR%;$$localedir;" \ $(LDAP_CONFIG) >> $@; \ $(CHMOD) 444 $@ diff --git a/include/ac/localize.h b/include/ac/localize.h new file mode 100644 index 0000000000..a3572346c3 --- /dev/null +++ b/include/ac/localize.h @@ -0,0 +1,37 @@ +/* localize.h (i18n/l10n) */ +/* $OpenLDAP$ */ +/* + * Copyright 2003 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. A copy of this license is available at + * http://www.OpenLDAP.org/license.html or in file LICENSE in the + * top-level directory of the distribution. + */ + +#ifndef _AC_LOCALIZE_H +#define _AC_LOCALIZE_H + +#ifdef LDAP_LOCALIZE +# include +# include + + /* enable i18n/l10n */ +# define gettext_noop(s) s +# define _(s) gettext(s) +# define N_(s) gettext_noop(s) + +#else + /* disable i18n/l10n */ +# define setlocale(c,l) /* empty */ + +# define _(s) s +# define N_(s) s +# define textdomain(d) /* empty */ +# define bindtextdomain(p,d) /* empty */ + +#endif + +#endif /* _AC_LOCALIZE_H */ diff --git a/include/ldap_config.h.in b/include/ldap_config.h.in index 46d96036ea..e59337e687 100644 --- a/include/ldap_config.h.in +++ b/include/ldap_config.h.in @@ -59,5 +59,9 @@ #ifndef LDAP_RUNDIR #define LDAP_RUNDIR "%RUNDIR%" #endif +#ifndef LDAP_LOCALEDIR +#define LDAP_LOCALEDIR "%LOCALEDIR%" +#endif + #endif /* _LDAP_CONFIG_H */ diff --git a/include/portable.h.in b/include/portable.h.in index 2d58390af9..66485a6acf 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -1077,5 +1077,6 @@ #include "ldap_features.h" #include "ac/assert.h" +#include "ac/localize.h" #endif /* _LDAP_PORTABLE_H */