Commit f56980ec authored by Brendan Cully's avatar Brendan Cully

Set GPGME locale on first attempt to create context.

Closes #2913.
parent a4b3a60d
......@@ -82,6 +82,11 @@
#define CRYPT_KV_STRONGID 8
#define CRYPT_KV_MATCH (CRYPT_KV_ADDR|CRYPT_KV_STRING)
/* static local variables */
#ifdef ENABLE_NLS
static int GpgmeLocaleSet = 0;
#endif
/*
* Type definitions.
*/
......@@ -339,6 +344,16 @@ static gpgme_ctx_t create_gpgme_context (int for_smime)
gpgme_error_t err;
gpgme_ctx_t ctx;
#ifdef ENABLE_NLS
if (!GpgmeLocaleSet)
{
gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
GpgmeLocaleSet = 1;
}
#endif
err = gpgme_new (&ctx);
if (err)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment