From 090769464f2d469c170ac7c01f65413455ae53c0 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 27 Sep 2010 23:03:29 +0200 Subject: [PATCH] * finish setting the wanted locale. --- citadel/utils/setup.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 } /* -- 2.30.2