2001-11-24 17:43:43 +00:00
|
|
|
/* i18n.h
|
|
|
|
* Copyright (C) 1998, 2001 Free Software Foundation, Inc.
|
|
|
|
*
|
2006-09-22 11:39:45 +00:00
|
|
|
* This file is free software; as a special exception the author gives
|
|
|
|
* unlimited permission to copy and/or distribute it, with or without
|
|
|
|
* modifications, as long as this notice is preserved.
|
2011-02-04 12:57:53 +01:00
|
|
|
*
|
2006-09-22 11:39:45 +00:00
|
|
|
* This file is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY, to the extent permitted by law; without even
|
|
|
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE.
|
2001-11-24 17:43:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNUPG_COMMON_I18N_H
|
|
|
|
#define GNUPG_COMMON_I18N_H
|
|
|
|
|
2007-06-06 18:12:30 +00:00
|
|
|
|
2001-11-24 17:43:43 +00:00
|
|
|
#ifdef USE_SIMPLE_GETTEXT
|
2010-03-10 12:24:58 +00:00
|
|
|
# include "../common/w32help.h"
|
2001-11-24 17:43:43 +00:00
|
|
|
# define _(a) gettext (a)
|
|
|
|
# define N_(a) (a)
|
|
|
|
#else
|
|
|
|
# ifdef HAVE_LOCALE_H
|
2011-02-04 12:57:53 +01:00
|
|
|
# include <locale.h>
|
2001-11-24 17:43:43 +00:00
|
|
|
# endif
|
|
|
|
# ifdef ENABLE_NLS
|
|
|
|
# include <libintl.h>
|
|
|
|
# define _(a) gettext (a)
|
|
|
|
# ifdef gettext_noop
|
|
|
|
# define N_(a) gettext_noop (a)
|
|
|
|
# else
|
|
|
|
# define N_(a) (a)
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define _(a) (a)
|
|
|
|
# define N_(a) (a)
|
2007-05-04 09:22:18 +00:00
|
|
|
# define ngettext(a,b,c) ((c)==1? (a):(b))
|
2001-11-24 17:43:43 +00:00
|
|
|
# endif
|
|
|
|
#endif /*!USE_SIMPLE_GETTEXT*/
|
|
|
|
|
2015-06-30 22:28:41 +02:00
|
|
|
#ifndef GNUPG_GCC_ATTR_FORMAT_ARG
|
|
|
|
#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */
|
|
|
|
# define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
|
|
|
|
#else
|
|
|
|
# define GNUPG_GCC_ATTR_FORMAT_ARG(a)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2007-06-06 18:12:30 +00:00
|
|
|
void i18n_init (void);
|
2007-10-19 15:58:38 +00:00
|
|
|
char *i18n_switchto_utf8 (void);
|
|
|
|
void i18n_switchback (char *saved_codeset);
|
|
|
|
const char *i18n_utf8 (const char *string);
|
2015-06-30 22:28:41 +02:00
|
|
|
const char *i18n_localegettext (const char *lc_messages, const char *string)
|
|
|
|
GNUPG_GCC_ATTR_FORMAT_ARG(2);
|
2015-06-30 21:58:02 +02:00
|
|
|
|
2015-11-16 12:41:46 +01:00
|
|
|
/* If a module wants a local L_() function we define it here. */
|
2015-06-30 21:58:02 +02:00
|
|
|
#ifdef LunderscoreIMPL
|
2015-06-30 22:28:41 +02:00
|
|
|
LunderscorePROTO
|
2015-06-30 21:58:02 +02:00
|
|
|
LunderscoreIMPL
|
|
|
|
#endif
|
2007-06-06 18:12:30 +00:00
|
|
|
|
|
|
|
|
2001-11-24 17:43:43 +00:00
|
|
|
#endif /*GNUPG_COMMON_I18N_H*/
|