1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* g10.c (i18n_init) [W32]: Pass registry key to gettext

initialization.
* gpgv.c (i18n_init) [W32]: Ditto.

* simple-gettext.c (set_gettext_file): Use MO files depending on
the installation directory.  Add new arg REGKEY.
This commit is contained in:
Werner Koch 2005-01-20 11:42:03 +00:00
parent b2d67e8039
commit 5bda87bd6e
19 changed files with 350 additions and 143 deletions

View file

@ -1,6 +1,6 @@
/* strgutil.c - string utilities
* Copyright (C) 1994, 1998, 1999, 2000, 2001,
* 2003 Free Software Foundation, Inc.
* 2003, 2004, 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -453,10 +453,33 @@ static void
handle_iconv_error (const char *to, const char *from, int use_fallback)
{
if (errno == EINVAL)
log_info (_("conversion from `%s' to `%s' not available\n"),
from, to);
{
static int shown1, shown2;
int x;
if (to && !strcmp (to, "utf-8"))
{
x = shown1;
shown1 = 1;
}
else
{
x = shown2;
shown2 = 1;
}
if (!x)
log_info (_("conversion from `%s' to `%s' not available\n"),
from, to);
}
else
log_info (_("iconv_open failed: %s\n"), strerror (errno));
{
static int shown;
if (!shown)
log_info (_("iconv_open failed: %s\n"), strerror (errno));
shown = 1;
}
if (use_fallback)
{
@ -706,8 +729,12 @@ native_to_utf8( const char *string )
if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes,
&outptr, &outbytes) == (size_t)-1)
{
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
active_charset_name, "utf-8", strerror (errno));
static int shown;
if (!shown)
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
active_charset_name, "utf-8", strerror (errno));
shown = 1;
/* We don't do any conversion at all but use the strings as is. */
strcpy (buffer, string);
}
@ -980,8 +1007,12 @@ utf8_to_native( const char *string, size_t length, int delim )
outbuf = outptr = m_alloc (outbytes);
if ( iconv (cd, (ICONV_CONST char **)&inptr, &inbytes,
&outptr, &outbytes) == (size_t)-1) {
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
"utf-8", active_charset_name, strerror (errno));
static int shown;
if (!shown)
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
"utf-8", active_charset_name, strerror (errno));
shown = 1;
/* Didn't worked out. Temporary disable the use of
* iconv and fall back to our old code. */
m_free (buffer);