]> code.citadel.org Git - citadel.git/blobdiff - webcit/gettext.c
Date picker is now localized to the currently selected
[citadel.git] / webcit / gettext.c
index 7e5caeb2f7129c9b7cd2218fd5afa55ba940a871..352b6f7cb5f93a9eeb4d8486793932d8453258c0 100644 (file)
@@ -204,7 +204,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) {
+void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType) {
        int i;
 #ifndef HAVE_USELOCALE
        char *Lang = getenv("LANG");
@@ -370,3 +370,22 @@ void TmplGettext(StrBuf *Target, int nTokens, WCTemplateToken *Token)
        StrBufAppendBufPlain(Target, _(Token->Params[0]->Start), -1, 0);
 
 }
+
+
+/*
+ * Returns the language currently in use.
+ * This function returns a static string, so don't do anything stupid please.
+ */
+const char *get_selected_language(void) {
+#ifdef ENABLE_NLS
+#ifdef HAVE_USELOCALE
+       return AvailLang[WC->selected_language];
+#else
+       return "en"
+#endif
+#else
+       return "en"
+#endif
+}
+
+