From: Art Cancro Date: Sun, 19 Feb 2012 22:47:30 +0000 (-0500) Subject: Call textdomain() and bindtextdomain() at the beginning of initialize_locales() inste... X-Git-Tag: v8.11~184^2~3 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=c68578c522448bdd34cb1d6ded094f25ec0578ff Call textdomain() and bindtextdomain() at the beginning of initialize_locales() instead of at the end. This has not yet solved my binding problem but it's definitely a step that is required. --- diff --git a/webcit/gettext.c b/webcit/gettext.c index 5ae103945..96c7206c5 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -293,6 +293,13 @@ void initialize_locales(void) { char buf[32]; char *language = NULL; +#ifdef ENABLE_NLS + setlocale(LC_ALL, ""); + syslog(9, "Text domain: %s", textdomain("webcit")); + syslog(9, "Message catalog directory: %s", bindtextdomain(textdomain(NULL), LOCALEDIR)); + syslog(9, "Text domain Charset: %s", bind_textdomain_codeset("webcit","UTF8")); +#endif + nLocales = 0; while (!IsEmptyStr(AvailLang[nLocales])) nLocales++; @@ -328,7 +335,12 @@ void initialize_locales(void) { (((i > 0) && (wc_locales[0] != NULL)) ? wc_locales[0] : Empty_Locale) ); if (wc_locales[nLocalesLoaded] == NULL) { - syslog(1, "locale for %s disabled: %s", buf, strerror(errno)); + syslog(1, "locale for %s disabled: %s (domain: %s, path: %s)", + buf, + strerror(errno), + textdomain(NULL), + bindtextdomain(textdomain(NULL), NULL) + ); } else { syslog(3, "Found locale: %s", buf); @@ -364,13 +376,6 @@ void initialize_locales(void) { AvailLangLoaded[0] = AvailLang[0]; nLocalesLoaded = 1; } - -#ifdef ENABLE_NLS - setlocale(LC_ALL, ""); - syslog(9, "Message catalog directory: %s", bindtextdomain("webcit", LOCALEDIR"/locale")); - syslog(9, "Text domain: %s", textdomain("webcit")); - syslog(9, "Text domain Charset: %s", bind_textdomain_codeset("webcit","UTF8")); -#endif }