From: Wilfried Goesgens Date: Mon, 27 Sep 2010 21:03:29 +0000 (+0200) Subject: * finish setting the wanted locale. X-Git-Tag: v8.01~686^2~6 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=090769464f2d469c170ac7c01f65413455ae53c0 * finish setting the wanted locale. --- diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index cbe30e96b..18e695329 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -102,12 +102,20 @@ const char *setup_text[eMaxQuestions]; void SetTitles(void) { + char *locale; int have_run_dir; #ifndef HAVE_RUN_DIR have_run_dir = 1; #else have_run_dir = 0; #endif + + locale = setlocale(LC_MESSAGES, getenv("LANG")); + + bindtextdomain("citadel-setup", LOCALEDIR"/locale"); + textdomain("citadel-setup"); + bind_textdomain_codeset("citadel-setup","UTF8"); + setup_titles[eCitadelHomeDir] = _("Citadel Home Directory"); if (have_run_dir) setup_text[eCitadelHomeDir] = _( @@ -214,6 +222,19 @@ void SetTitles(void) "If you entered a Bind DN in the previous question, you must now enter\n" "the password associated with that account. Otherwise, you can leave this\n" "blank.\n"); + +#if 0 +// Debug loading of locales... Strace does a better job though. + printf("Message catalog directory: %s\n", bindtextdomain("citadel-setup", LOCALEDIR"/locale")); + printf("Text domain: %s\n", textdomain("citadel-setup")); + printf("Text domain Charset: %s\n", bind_textdomain_codeset("citadel-setup","UTF8")); + { + int i; + for (i = 0; i < eMaxQuestions; i++) + printf("%s - %s\n", setup_titles[i], _(setup_titles[i])); + exit(0); + } +#endif } /*