diff options
Diffstat (limited to 'src/w32-gettext.h')
-rw-r--r-- | src/w32-gettext.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/w32-gettext.h b/src/w32-gettext.h new file mode 100644 index 0000000..b85528a --- /dev/null +++ b/src/w32-gettext.h @@ -0,0 +1,54 @@ +/* w32-gettext.h - A simple gettext implementation for Windows targets. + Copyright (C) 2005 g10 Code GmbH + + This file is part of libgpg-error. + + libgpg-error is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + libgpg-error is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libgpg-error; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if ENABLE_NLS + +#include <locale.h> +#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) +# define LC_MESSAGES 1729 +#endif + +/* If we build on w32, we will use our own simple gettext + implementation. For now, this is not a drop in replacement, so we + must cheat a bit and redirect all calls to the external gettext to + an internal implementation. We try to be as little invasive as + possible, so that the refactorization of the code occurs at logical + interfaces. + + Note that this function intimately knows the various definitions in + the target libintl.h and the local gettext.h file, from which it is + included. */ + +#define bindtextdomain _gpg_err_bindtextdomain +#define textdomain _gpg_err_textdomain +#define dgettext _gpg_err_dgettext +#define gettext _gpg_err_gettext + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +char *bindtextdomain (const char *domainname, const char *dirname); + +const char *gettext (const char *msgid); + +char *textdomain (const char *domainname); + +char *libintl_dgettext (const char *domainname, const char *msgid); + +#endif /* ENABLE_NLS */ |