Index: pam_krb5-2.2.22-1/configure.ac =================================================================== --- pam_krb5-2.2.22-1.orig/configure.ac +++ pam_krb5-2.2.22-1/configure.ac @@ -444,6 +444,24 @@ AC_SUBST(TESTHOST) AC_SUBST(default_ccache_dir) AC_SUBST(default_ccname_template) +AC_PATH_PROG(XGETTEXT, xgettext) +if test -z "$XGETTEXT" ; then + AC_MSG_ERROR(xgettext is missing; please install gettext.) +fi + +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.16) + +AH_VERBATIM([_ZZENABLE_NLS], + [#ifdef ENABLE_NLS + #include + #define _(msgid) dgettext(PACKAGE, msgid) + #define N_(msgid) msgid + #else + #define _(msgid) (msgid) + #define N_(msgid) msgid + #endif /* ENABLE_NLS */]) + AC_CONFIG_HEADER(config.h) AC_OUTPUT([ Makefile @@ -467,4 +485,5 @@ tests/tools/klist_f tests/tools/klist_c tests/tools/klist_a tests/tools/klist_4 +po/Makefile.in ]) Index: pam_krb5-2.2.22-1/Makefile.am =================================================================== --- pam_krb5-2.2.22-1.orig/Makefile.am +++ pam_krb5-2.2.22-1/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = pam_krb5.spec TODO README R CONFIGURE_DEPENDENCIES = $(top_srcdir)/pam_krb5.spec -SUBDIRS = src tests +SUBDIRS = src tests po VERSION=$(shell rpm -q --specfile $(top_srcdir)/pam_krb5.spec --qf '%{version}\n' | head -n1) RELEASE=$(shell rpm -q --specfile $(top_srcdir)/pam_krb5.spec --qf '%{release}\n' | head -n1) Index: pam_krb5-2.2.22-1/config.h.in =================================================================== --- pam_krb5-2.2.22-1.orig/config.h.in +++ pam_krb5-2.2.22-1/config.h.in @@ -274,6 +274,19 @@ #define PAM_KRB5_GNUC_PRINTF(__x,__y) #endif +/* Define to 1 if translation of program messages to the user's native + * language is requested. */ +#undef ENABLE_NLS + +#ifdef ENABLE_NLS +#include +#define _(msgid) dgettext(PACKAGE, msgid) +#define N_(msgid) msgid +#else +#define _(msgid) (msgid) +#define N_(msgid) msgid +#endif /* ENABLE_NLS */ + /* Define to the proper qualifier (either const or nothing) for your PAM implementation. */ Index: pam_krb5-2.2.22-1/src/auth.c =================================================================== --- pam_krb5-2.2.22-1.orig/src/auth.c +++ pam_krb5-2.2.22-1/src/auth.c @@ -283,7 +283,7 @@ pam_sm_authenticate(pam_handle_t *pamh, if ((retval != PAM_SUCCESS) && (retval != PAM_USER_UNKNOWN) && options->use_second_pass) { - i = _pam_krb5_prompt_for(pamh, "Password: ", &second_pass); + i = _pam_krb5_prompt_for(pamh, _("Password: "), &second_pass); if ((i == PAM_SUCCESS) && (flags & PAM_DISALLOW_NULL_AUTHTOK) && (second_pass != NULL) && Index: pam_krb5-2.2.22-1/src/password.c =================================================================== --- pam_krb5-2.2.22-1.orig/src/password.c +++ pam_krb5-2.2.22-1/src/password.c @@ -257,7 +257,7 @@ pam_sm_chauthtok(pam_handle_t *pamh, int } if ((password == NULL) && (options->use_second_pass)) { /* Ask the user for a password. */ - sprintf(prompt, "%s%sPassword: ", + sprintf(prompt, _("%s%sPassword: "), options->banner, strlen(options->banner) > 0 ? " " : ""); i = _pam_krb5_prompt_for(pamh, prompt, &password); @@ -345,10 +345,10 @@ pam_sm_chauthtok(pam_handle_t *pamh, int * okay with that, ask for one. */ if ((password == NULL) && (retval == PAM_AUTHTOK_ERR)) { /* Ask for the new password twice. */ - sprintf(prompt, "New %s%sPassword: ", + sprintf(prompt, _("New %s%sPassword: "), options->banner, strlen(options->banner) > 0 ? " " : ""); - sprintf(prompt2, "Repeat New %s%sPassword: ", + sprintf(prompt2, _("Repeat New %s%sPassword: "), options->banner, strlen(options->banner) > 0 ? " " : ""); i = _pam_krb5_prompt_for_2(pamh, prompt, &password, Index: pam_krb5-2.2.22-1/po/POTFILES.in =================================================================== --- /dev/null +++ pam_krb5-2.2.22-1/po/POTFILES.in @@ -0,0 +1,2 @@ +src/auth.c +src/password.c