projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplified tmplput_offer_languages() behavior on non-locale systems
[citadel.git]
/
webcit
/
gettext.c
diff --git
a/webcit/gettext.c
b/webcit/gettext.c
index 25474e810c5b8f68eb2f521cdc90de0be6dbb3ad..4df641a28e7ce01f4eb1a8fda82878ae59140fa1 100644
(file)
--- a/
webcit/gettext.c
+++ b/
webcit/gettext.c
@@
-209,25
+209,12
@@
void httplang_to_locale(StrBuf *LocaleString, wcsession *sess)
*/
void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP)
{
*/
void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP)
{
+#ifdef HAVE_USELOCALE
int i;
int i;
-#ifndef HAVE_USELOCALE
- char *Lang = getenv("LANG");
-
- if (Lang == NULL)
- Lang = "C";
-#endif
-
- if (nLocalesLoaded == 1) {
- wc_printf("<p>%s</p>", AvailLangLoaded[0]);
- return;
- }
wc_printf("<select name=\"language\" id=\"lname\" size=\"1\" onChange=\"switch_to_lang($('lname').value);\">\n");
for (i=0; i < nLocalesLoaded; ++i) {
wc_printf("<select name=\"language\" id=\"lname\" size=\"1\" onChange=\"switch_to_lang($('lname').value);\">\n");
for (i=0; i < nLocalesLoaded; ++i) {
-#ifndef HAVE_USELOCALE
- if (strcmp(AvailLangLoaded[i], Lang) == 0)
-#endif
wc_printf("<option %s value=%s>%s</option>\n",
((WC->selected_language == i) ? "selected" : ""),
AvailLangLoaded[i],
wc_printf("<option %s value=%s>%s</option>\n",
((WC->selected_language == i) ? "selected" : ""),
AvailLangLoaded[i],
@@
-236,6
+223,9
@@
void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP)
}
wc_printf("</select>\n");
}
wc_printf("</select>\n");
+#else
+ wc_printf("%s", (getenv("LANG") ? getenv("LANG") : "C"));
+#endif
}
/*
}
/*