* typedef wcsession, so we don't always need to say gcc again its a struct.
[citadel.git] / webcit / gettext.c
index 0994161e77cd59aabd8450c029dc6571b7f4e84b..f055ee5a320f9a7742d3d57ff1ec288f302b542f 100644 (file)
@@ -205,7 +205,7 @@ void httplang_to_locale(StrBuf *LocaleString)
  * depending on the browser locale change the sequence of the 
  * language chooser.
  */
-void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType) {
+void tmplput_offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) {
        int i;
 #ifndef HAVE_USELOCALE
        char *Lang = getenv("LANG");
@@ -251,7 +251,7 @@ void set_selected_language(const char *lang) {
  */
 void go_selected_language(void) {
 #ifdef HAVE_USELOCALE
-       struct wcsession *WCC = WC;
+       wcsession *WCC = WC;
        if (WCC->selected_language < 0) return;
        uselocale(wc_locales[WCC->selected_language]);  /** switch locales */
        textdomain(textdomain(NULL));                   /** clear the cache */
@@ -344,7 +344,7 @@ void ShutdownLocale(void)
 
 #else  /* ENABLE_NLS */
 /** \brief dummy for non NLS enabled systems */
-void offer_languages(void) {
+void tmplput_offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType) {
        wprintf("English (US)");
 }
 
@@ -366,10 +366,9 @@ void preset_locale(void)
 #endif /* ENABLE_NLS */
 
 
-void TmplGettext(StrBuf *Target, int nTokens, WCTemplateToken *Token)
+void TmplGettext(StrBuf *Target, int nTokens, WCTemplateToken *Tokens)
 {
-       StrBufAppendBufPlain(Target, _(Token->Params[0]->Start), -1, 0);
-
+       StrBufAppendBufPlain(Target, _(Tokens->Params[0]->Start), -1, 0);
 }
 
 
@@ -389,4 +388,9 @@ const char *get_selected_language(void) {
 #endif
 }
 
-
+void 
+InitModule_GETTEXT
+(void)
+{
+       RegisterNamespace("LANG:SELECT", 0, 0, tmplput_offer_languages, CTX_NONE);
+}