]> git.sur5r.net Git - openldap/commitdiff
Basic infrastructure for i18n/l10n
authorKurt Zeilenga <kurt@openldap.org>
Sat, 5 Apr 2003 20:49:16 +0000 (20:49 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 5 Apr 2003 20:49:16 +0000 (20:49 +0000)
include/Makefile.in
include/ac/localize.h [new file with mode: 0644]
include/ldap_config.h.in
include/portable.h.in

index 7a846c8f24d9ba00a92f9804a33c0fd9cd0a5a67..969591c487b6c59faa4e8ad4fedcf85d8015829e 100644 (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 $@
 
diff --git a/include/ac/localize.h b/include/ac/localize.h
new file mode 100644 (file)
index 0000000..a357234
--- /dev/null
@@ -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 */
index 46d96036ea11e3e08eb8298a9d5b7cb65cd8d82a..e59337e68751163fa5518f025dc366800dedcd17 100644 (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 */
index 2d58390af9ebdaa3cfba837f9011efa0259bdb17..66485a6acfa0c33840623f0f8c1ed0f31de3ee24 100644 (file)
 #include "ldap_features.h"
 
 #include "ac/assert.h"
+#include "ac/localize.h"
 
 #endif /* _LDAP_PORTABLE_H */