Make i18n support compile.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23738 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -40,20 +40,24 @@ RCSID("$Id$");
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <com_right.h>
|
#include <com_right.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBINTL
|
||||||
|
#include <libintl.h>
|
||||||
|
#else
|
||||||
|
#define dgettext(d,s) (s)
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
com_right(struct et_list *list, long code)
|
com_right(struct et_list *list, long code)
|
||||||
{
|
{
|
||||||
struct et_list *p;
|
struct et_list *p;
|
||||||
for (p = list; p; p = p->next) {
|
for (p = list; p; p = p->next) {
|
||||||
if (code >= p->table->base && code < p->table->base + p->table->n_msgs) {
|
if (code >= p->table->base && code < p->table->base + p->table->n_msgs) {
|
||||||
char *p = p->table->msgs[code - p->table->base];
|
const char *str = p->table->msgs[code - p->table->base];
|
||||||
#ifdef HAVE_LIBINTL
|
#ifdef HAVE_LIBINTL
|
||||||
char domain[6 + 1 + 20];
|
char domain[6 + 1 + 20];
|
||||||
snprintf(domain, sizeof(domain), "com_err%d", p->table->base);
|
snprintf(domain, sizeof(domain), "com_err%d", p->table->base);
|
||||||
return dgettext(domain, p);
|
|
||||||
#else
|
|
||||||
return p;
|
|
||||||
#endif
|
#endif
|
||||||
|
return dgettext(domain, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user