diff options
author | Werner Koch <[email protected]> | 2008-11-04 19:54:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2008-11-04 19:54:02 +0000 |
commit | 75c0534820958f69731dc3e07d839ad7e18474a4 (patch) | |
tree | bb81e738e6c59c488e706d515060ca4b5b3ea62f /common | |
parent | Fixed the card removed with cached app bug. (Famous last fix). (diff) | |
download | gnupg-75c0534820958f69731dc3e07d839ad7e18474a4.tar.gz gnupg-75c0534820958f69731dc3e07d839ad7e18474a4.zip |
Revamped the W32 gettext implementation.
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 7 | ||||
-rw-r--r-- | common/homedir.c | 21 | ||||
-rw-r--r-- | common/i18n.c | 2 | ||||
-rw-r--r-- | common/util.h | 1 |
4 files changed, 29 insertions, 2 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 9e3c450d9..94de8fd26 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,5 +1,10 @@ -2008-10-20 Werner Koch <[email protected]> +2008-11-04 Werner Koch <[email protected]> + + * i18n.c (i18n_init) [USE_SIMPLE_GETTEXT]: Adjust for changed + w32-gettext.c. + * homedir.c (gnupg_localedir): New. +2008-10-20 Werner Koch <[email protected]> * http.c (http_register_tls_callback) [!HTTP_USE_GNUTLS]: Mark unused arg. diff --git a/common/homedir.c b/common/homedir.c index b21646c78..74f3a0d1f 100644 --- a/common/homedir.c +++ b/common/homedir.c @@ -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) diff --git a/common/i18n.c b/common/i18n.c index daa147faa..db5ddf5f8 100644 --- a/common/i18n.c +++ b/common/i18n.c @@ -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, "" ); diff --git a/common/util.h b/common/util.h index b21e9283d..29955a494 100644 --- a/common/util.h +++ b/common/util.h @@ -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 |