Basic infrastructure for i18n/l10n

This commit is contained in:
Kurt Zeilenga 2003-04-05 20:49:16 +00:00
parent 1bae6d28e5
commit 4809e4da1e
4 changed files with 44 additions and 0 deletions

View File

@ -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 $@

37
include/ac/localize.h Normal file
View File

@ -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 <locale.h>
# include <libintl.h>
/* 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 */

View File

@ -59,5 +59,9 @@
#ifndef LDAP_RUNDIR
#define LDAP_RUNDIR "%RUNDIR%"
#endif
#ifndef LDAP_LOCALEDIR
#define LDAP_LOCALEDIR "%LOCALEDIR%"
#endif
#endif /* _LDAP_CONFIG_H */

View File

@ -1077,5 +1077,6 @@
#include "ldap_features.h"
#include "ac/assert.h"
#include "ac/localize.h"
#endif /* _LDAP_PORTABLE_H */