From 018a1f2aef63580bceba968c91255f7c6aea0c1c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 23 Feb 2012 00:31:41 -0500 Subject: [PATCH] Scan for language files during bootstrap instead of using a hard-coded list. --- webcit/.gitignore | 1 + webcit/gettext.c | 35 ++--------------------------------- webcit/mk_module_init.sh | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/webcit/.gitignore b/webcit/.gitignore index 2be77a2f2..042f838f2 100644 --- a/webcit/.gitignore +++ b/webcit/.gitignore @@ -13,6 +13,7 @@ ical_maps.c locale/ modules_init.c modules_init.h +language_list.c po/Makefile setup sysdep.h diff --git a/webcit/gettext.c b/webcit/gettext.c index 4df641a28..1e51e93ac 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -15,33 +15,7 @@ #define SEARCH_LANG 20 /* how many langs should we parse? */ #ifdef ENABLE_NLS -/* actual supported locales */ -const char *AvailLang[] = { - "C", - "bg_BG", - "cs_CZ", - "en_US", - "da_DK", - "de_DE", - "el_GR", - "en_GB", - "es_ES", - "et_EE", - "fi_FI", - "fr_FR", - "hu_HU", - "it_IT", - "nl_NL", - "pt_BR", - "ru_RU", - "zh_CN", - "he_IL", - "kk_KK", - "ro_RO", - "sl_SL", - "tr_TR", - "" -}; +#include "language_list.h" const char **AvailLangLoaded; long nLocalesLoaded = 0; @@ -312,12 +286,7 @@ void initialize_locales(void) { wc_locales[0] ); if (wc_locales[nLocalesLoaded] == NULL) { - syslog(1, "locale for %s disabled: %s (domain: %s, path: %s)", - AvailLang[i], - strerror(errno), - textdomain(NULL), - bindtextdomain(textdomain(NULL), NULL) - ); + syslog(1, "locale for %s disabled: %s", AvailLang[i], strerror(errno)); } else { syslog(3, "Found locale: %s", AvailLang[i]); diff --git a/webcit/mk_module_init.sh b/webcit/mk_module_init.sh index ae1cd3751..6f6871bf2 100755 --- a/webcit/mk_module_init.sh +++ b/webcit/mk_module_init.sh @@ -26,6 +26,7 @@ H_FILE="$CUR_DIR/modules_init.h" MOD_FILE="$CUR_DIR/Make_modules" SRC_FILE="$CUR_DIR/Make_sources" U_FILE="$CUR_DIR/modules_upgrade.c" +L_FILE="$CUR_DIR/language_list.h" /usr/bin/printf "Scanning extension modules for entry points.\n" @@ -501,3 +502,25 @@ cat <> $H_FILE #endif /* MODULES_INIT_H */ EOF + + +### Now see what language modules we have installed ### +/usr/bin/printf "Scanning language modules.\n" + +cat >$L_FILE <>$L_FILE + +cat >>$L_FILE <