Revamped the W32 gettext implementation.

This commit is contained in:
Werner Koch 2008-11-04 19:54:02 +00:00
parent 4019792423
commit 75c0534820
8 changed files with 1117 additions and 1085 deletions

View File

@ -1,5 +1,10 @@
2008-10-20 Werner Koch <wk@g10code.com>
2008-11-04 Werner Koch <wk@g10code.com>
* i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Adjust for changed
w32-gettext.c.
* homedir.c (gnupg_localedir): New.
2008-10-20 Werner Koch <wk@g10code.com>
* http.c (http_register_tls_callback) [!HTTP_USE_GNUTLS]: Mark
unused arg.

View File

@ -322,6 +322,27 @@ gnupg_datadir (void)
}
const char *
gnupg_localedir (void)
{
#ifdef HAVE_W32_SYSTEM
static char *name;
if (!name)
{
const char *s1, *s2;
s1 = w32_rootdir ();
s2 = DIRSEP_S "share" DIRSEP_S "locale";
name = xmalloc (strlen (s1) + strlen (s2) + 1);
strcpy (stpcpy (name, s1), s2);
}
return name;
#else /*!HAVE_W32_SYSTEM*/
return LOCALEDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
/* Return the default socket name used by DirMngr. */
const char *
dirmngr_socket_name (void)

View File

@ -33,7 +33,7 @@ void
i18n_init (void)
{
#ifdef USE_SIMPLE_GETTEXT
set_gettext_file (PACKAGE_GT, "Software\\GNU\\GnuPG");
bindtextdomain (PACKAGE_GT, gnupg_localedir ());
#else
# ifdef ENABLE_NLS
setlocale (LC_ALL, "" );

View File

@ -208,6 +208,7 @@ const char *gnupg_bindir (void);
const char *gnupg_libexecdir (void);
const char *gnupg_libdir (void);
const char *gnupg_datadir (void);
const char *gnupg_localedir (void);
const char *dirmngr_socket_name (void);
/* All module names. We also include gpg and gpgsm for the sake for

View File

@ -1,3 +1,10 @@
2008-11-04 Werner Koch <wk@g10code.com>
* w32-gettext.c: Merged with code from libgpg-error and rewrote
most parts.
* Makefile.am (AM_CFLAGS): Add -DJNLIB_IN_JNLIB.
2008-10-29 Werner Koch <wk@g10code.com>
* stringhelp.c (make_filename): Implement using macros. Factor some

View File

@ -27,7 +27,7 @@ TESTS = $(module_tests)
AM_CPPFLAGS = -I$(top_srcdir)/intl
# We need libgcrypt because libjnlib-config includes gcrypt.h
AM_CFLAGS = $(LIBGCRYPT_CFLAGS)
AM_CFLAGS = -DJNLIB_IN_JNLIB $(LIBGCRYPT_CFLAGS)
noinst_LIBRARIES = libjnlib.a

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@ int write_w32_registry_string (const char *root, const char *dir,
const char *name, const char *value);
#ifdef USE_SIMPLE_GETTEXT
int set_gettext_file (const char *filename, const char *regkey);
char *bindtextdomain (const char *domainname, const char *dirname);
const char *gettext (const char *msgid );
const char *ngettext (const char *msgid1, const char *msgid2,
unsigned long int n);