diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-09-29 02:21:29 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-09-29 02:21:29 +0000 |
commit | 5b6d2d38d28a9e5983f45d18db13bcceec8385c1 (patch) | |
tree | 2773c53af5eed53a125c617c5b24d5546e2552f6 | |
parent | 6dbb1c1eccf35f0de4692f1d91e6f07cd7e99db4 (diff) |
check for HAVE_LOCALE_H and ENABLE_NLS.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2045 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | libsylph/codeconv.c | 2 | ||||
-rw-r--r-- | src/main.c | 8 |
4 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2008-09-29 + + * src/main.c + libsylph/codeconv.c: check for HAVE_LOCALE_H and ENABLE_NLS + (thanks to Enrico Troger). + 2008-09-26 * src/inc.c diff --git a/ChangeLog.ja b/ChangeLog.ja index 93dc6385..7c6ee9aa 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,9 @@ +2008-09-29 + + * src/main.c + libsylph/codeconv.c: HAVE_LOCALE_H と ENABLE_NLS をチェックする + ようにした(Enrico Troger さん thanks)。 + 2008-09-26 * src/inc.c diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index 08f60e22..36dd264c 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -2061,8 +2061,10 @@ const gchar *conv_get_current_locale(void) cur_locale = g_getenv("LC_CTYPE"); if (!cur_locale || *cur_locale == '\0') cur_locale = g_getenv("LANG"); +#ifdef HAVE_LOCALE_H if (!cur_locale || *cur_locale == '\0') cur_locale = setlocale(LC_CTYPE, NULL); +#endif /* HAVE_LOCALE_H */ #endif /* G_OS_WIN32 */ debug_print("current locale: %s\n", @@ -590,7 +590,9 @@ static void app_init(void) g_unsetenv("LANGUAGE"); #endif +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, ""); +#endif prog_version = PROG_VERSION; set_startup_dir(); @@ -602,6 +604,7 @@ static void app_init(void) g_free(newpath); #endif +#ifdef ENABLE_NLS if (g_path_is_absolute(LOCALEDIR)) bindtextdomain(PACKAGE, LOCALEDIR); else { @@ -620,13 +623,14 @@ static void app_init(void) locale_dir = locale_dir_; } } -#endif +#endif /* G_OS_WIN32 */ bindtextdomain(PACKAGE, locale_dir); g_free(locale_dir); } bind_textdomain_codeset(PACKAGE, CS_UTF_8); textdomain(PACKAGE); +#endif /* ENABLE_NLS */ #ifdef G_OS_WIN32 read_ini_file(); @@ -823,9 +827,11 @@ static void check_gpg(void) /* Also does some gpgme init */ gpgme_engine_info_t engineInfo; +#if HAVE_LOCALE_H gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); +#endif if (!gpgme_get_engine_info(&engineInfo)) { while (engineInfo) { |