projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
010f767
)
Revert "Simplified tmplput_offer_languages() behavior on non-locale systems"
author
Art Cancro
<ajc@uncensored.citadel.org>
Sun, 26 Feb 2012 20:15:44 +0000
(15:15 -0500)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Sun, 26 Feb 2012 20:15:44 +0000
(15:15 -0500)
This reverts commit
58df800218902d07dcf3b81a28c31354fb1025d2
.
webcit/gettext.c
patch
|
blob
|
history
diff --git
a/webcit/gettext.c
b/webcit/gettext.c
index 4df641a28e7ce01f4eb1a8fda82878ae59140fa1..25474e810c5b8f68eb2f521cdc90de0be6dbb3ad 100644
(file)
--- a/
webcit/gettext.c
+++ b/
webcit/gettext.c
@@
-209,12
+209,25
@@
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],
@@
-223,9
+236,6
@@
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
}
/*
}
/*