mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Basic infrastructure for i18n/l10n
This commit is contained in:
parent
1bae6d28e5
commit
4809e4da1e
@ -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
37
include/ac/localize.h
Normal 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 */
|
@ -59,5 +59,9 @@
|
||||
#ifndef LDAP_RUNDIR
|
||||
#define LDAP_RUNDIR "%RUNDIR%"
|
||||
#endif
|
||||
#ifndef LDAP_LOCALEDIR
|
||||
#define LDAP_LOCALEDIR "%LOCALEDIR%"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _LDAP_CONFIG_H */
|
||||
|
@ -1077,5 +1077,6 @@
|
||||
#include "ldap_features.h"
|
||||
|
||||
#include "ac/assert.h"
|
||||
#include "ac/localize.h"
|
||||
|
||||
#endif /* _LDAP_PORTABLE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user