plugins/preauth/pkinit \
plugins/preauth/encrypted_challenge \
kdc kadmin slave clients appl tests \
- config-files gen-manpages
+ config-files gen-manpages po
WINSUBDIRS=include util lib ccapi windows clients appl
BUILDTOP=$(REL).
LOCALINCLUDES = -I$(srcdir)
KRB5_PA_MODULE_DIR = $(MODULE_DIR)/preauth
KRB5_AD_MODULE_DIR = $(MODULE_DIR)/authdata
KRB5_LIBKRB5_MODULE_DIR = $(MODULE_DIR)/libkrb5
+KRB5_LOCALEDIR = @localedir@
GSS_MODULE_DIR = @libdir@/gss
KRB5_INCSUBDIRS = \
$(KRB5_INCDIR)/kadm5 \
LIBUTIL=-lutil
])
AC_SUBST(LIBUTIL)
+
+AC_CHECK_HEADER(libintl.h, [
+ AC_SEARCH_LIBS(dgettext, intl, [
+ AC_DEFINE(ENABLE_NLS, 1,
+ [Define if translation functions should be used.])])])
+
# for kdc
AC_CHECK_HEADERS(syslog.h sys/sockio.h ifaddrs.h unistd.h)
AC_CHECK_FUNCS(openlog syslog closelog strftime vsprintf vasprintf vsnprintf)
tests/verify tests/gssapi tests/dejagnu tests/threads tests/shlib
tests/gss-threads tests/misc tests/mkeystash_compat
util/gss-kernel-lib util/collected-client-lib
+ po
)
#ifndef K5_ERR_H
#define K5_ERR_H
-#ifndef _
-#define _(X) (X)
-#endif
-
#if defined(_MSDOS) || defined(_WIN32)
#include <win-mac.h>
#endif
* + consistent getpwnam/getpwuid interfaces
* + va_copy fudged if not provided
* + [v]asprintf
+ * + _, N_, dgettext, bindtextdomain, setlocale (for localization)
*/
#ifndef K5_PLATFORM_H
extern void krb5int_zap(void *ptr, size_t len);
-/* Fudge for future adoption of gettext or the like. */
-#ifndef _
-#define _(X) (X)
+/*
+ * Localization macros. If we have gettext, define _ appropriately for
+ * translating a string. If we do not have gettext, define _, bindtextdomain,
+ * and setlocale as no-ops. N_ is always a no-op; it marks a string for
+ * extraction to pot files but does not translate it.
+ */
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define KRB5_TEXTDOMAIN "mit-krb5"
+#define _(s) dgettext(KRB5_TEXTDOMAIN, s)
+#else
+#define _(s) s
+#define dgettext(d, m) m
+#define bindtextdomain(p, d)
+#define setlocale(c, l)
#endif
+#define N_(s) s
#endif /* K5_PLATFORM_H */
LOCALINCLUDES = -I$(srcdir)/ccache -I$(srcdir)/keytab -I$(srcdir)/rcache -I$(srcdir)/os -I$(srcdir)/unicode
SUBDIRS= error_tables asn.1 ccache keytab krb os rcache unicode
WINSUBDIRS= $(SUBDIRS) posix
-DEFS=
+DEFS=-DLOCALEDIR=\"$(KRB5_LOCALEDIR)\"
##DOSBUILDTOP = ..\..
##DOSLIBNAME=$(OUTPRE)krb5.lib
add_error_table(&et_asn1_error_table);
add_error_table(&et_k524_error_table);
+ bindtextdomain(KRB5_TEXTDOMAIN, LOCALEDIR);
+
err = krb5int_rc_finish_init();
if (err)
return err;
--- /dev/null
+mydir=po
+BUILDTOP=$(REL)..
+VER=@PACKAGE_VERSION@
+
+DOMAIN=mit-krb5
+POTFILE=$(srcdir)/$(DOMAIN).pot
+XGETTEXT=xgettext --foreign-user --package-name=mit-krb5 \
+ --package-version=$(VER) --copyright-holder=MIT
+# This is a placeholder until we have an actual translation.
+CATALOGS=en_US.mo
+
+.SUFFIXES: .po .mo
+.po.mo:
+ msgfmt -o $@ $<
+
+all:: $(CATALOGS)
+
+update-po: csrcs
+ $(XGETTEXT) -k_ -kN_ -o $(POTFILE) -f csrcs
+
+csrcs: always
+ find $(top_srcdir) -name "*.c" -print > $@
+
+always:
+
+install::
+ for c in $(CATALOGS); do \
+ lang=`basename $$c .mo`; \
+ $(top_srcdir)/config/mkinstalldirs \
+ $(DESTDIR)$(KRB5_LOCALEDIR)/$$lang/LC_MESSAGES; \
+ install -c $$c \
+ $(DESTDIR)$(KRB5_LOCALEDIR)/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
+ done
--- /dev/null
+# No dependencies here.
--- /dev/null
+# English translations for Kerberos 5 package.
+# Copyright (C) 2011 MIT
+# This file is distributed under the same license as the Kerberos 5 package.
+# Greg Hudson <ghudson@mit.edu>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mit-krb5 1.10-prerelease\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-06-06 00:34-0400\n"
+"PO-Revision-Date: 2011-06-06 00:35-0400\n"
+"Last-Translator: Greg Hudson <ghudson@mit.edu>\n"
+"Language-Team: English\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR MIT
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: mit-krb5 1.10-prerelease\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-06-06 00:34-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"