#include "webserver.h"
#ifdef ENABLE_NLS
-
-#define NUM_LANGS 10 /* how many different locales do we know? */
-#define SEARCH_LANG 20 /* how many langs should we parse? */
-
/* actual supported locales */
const char *AvailLang[NUM_LANGS] = {
"C",
* depending on the browser locale change the sequence of the
* language chooser.
*/
-void tmplput_offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) {
+void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP)
+{
int i;
#ifndef HAVE_USELOCALE
char *Lang = getenv("LANG");
void preset_locale(void)
{
-#ifndef HAVE_USELOCALE
#ifdef HAVE_GETTEXT
char *language;
- lprintf(9, "Nailing locale to %s\n", getenv("LANG"));
- language = getenv("LANG");
- setlocale(LC_MESSAGES, language);
-#endif
+ language = getenv("WEBCIT_LANG");
+ if ((language) && (!IsEmptyStr(language)) && (strcmp(language, "UNLIMITED") != 0)) {
+ lprintf(9, "Nailing locale to %s\n", language);
+ setlocale(LC_MESSAGES, language);
+ }
#endif
}
}
#else /* ENABLE_NLS */
+const char *AvailLang[NUM_LANGS] = {
+ "C"};
+
/** \brief dummy for non NLS enabled systems */
-void tmplput_offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) {
+void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP)
+{
wprintf("English (US)");
}
#endif /* ENABLE_NLS */
-void TmplGettext(StrBuf *Target, int nTokens, WCTemplateToken *Tokens)
+void TmplGettext(StrBuf *Target, WCTemplputParams *TP)
{
- StrBufAppendBufPlain(Target, _(Tokens->Params[0]->Start), -1, 0);
+ StrBufAppendBufPlain(Target, _(TP->Tokens->Params[0]->Start), -1, 0);
}