projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c9601d
)
Simplified tmplput_offer_languages() behavior on non-locale systems
author
Art Cancro
<ajc@uncensored.citadel.org>
Tue, 21 Feb 2012 23:44:40 +0000
(18:44 -0500)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Tue, 21 Feb 2012 23:44:40 +0000
(18:44 -0500)
webcit/gettext.c
patch
|
blob
|
history
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
}
/*
}
/*