Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Current version and year in footer
            footerVer.InnerText  = VerStr;
            footerYear.InnerText = DateTime.Now.Year.ToString();

            // Hilite language in selector
            if (uiLang == "de")
            {
                langselDe.Attributes["class"] = langselDe.Attributes["class"] + " active";
            }
            else if (uiLang == "en")
            {
                langselEn.Attributes["class"] = langselEn.Attributes["class"] + " active";
            }
            else if (uiLang == "jian")
            {
                langselJian.Attributes["class"] = langselJian.Attributes["class"] + " active";
            }
            else if (uiLang == "fan")
            {
                langselFan.Attributes["class"] = langselFan.Attributes["class"] + " active";
            }

            // Server-side localized UI in master
            TextProvider prov = TextProvider.Instance;

            if (!descrAndKeywSet)
            {
                Page.MetaDescription = prov.GetString(uiLang, "MetaDescription");
                Page.MetaKeywords    = prov.GetString(uiLang, "MetaKeywords");
            }
            linkSearch.InnerText        = prov.GetString(uiLang, "MenuSearch");
            linkOptions.InnerText       = prov.GetString(uiLang, "MenuOptions");
            linkAbout.InnerText         = prov.GetString(uiLang, "MenuInfo");
            navImprint.InnerText        = prov.GetString(uiLang, "MenuImprint");
            linkFooterImprint.InnerText = prov.GetString(uiLang, "MenuImprint");
            bitterCookieTalks.Text      = prov.GetString(uiLang, "CookieNotice");
            swallowbitterpill.InnerText = prov.GetString(uiLang, "CookieAccept");
            cookierecipe.InnerText      = prov.GetString(uiLang, "CookieLearnMore");

            // Make relevant menu item "active"
            if (pageName == "search")
            {
                navSearch.Attributes["class"] = navSearch.Attributes["class"] + " active";
            }
            else if (pageName == "about")
            {
                navAbout.Attributes["class"] = navAbout.Attributes["class"] + " active";
            }
            else if (pageName == "options")
            {
                navOptions.Attributes["class"] = navAbout.Attributes["class"] + " active";
            }
        }
Exemplo n.º 2
0
        void Application_Start(object sender, EventArgs e)
        {
            // Init query logger
            QueryLogger.Init();

            // Load dictionary
            string dictFilePath = HttpRuntime.AppDomainAppPath;

            dictFilePath = Path.Combine(dictFilePath, "_data");
            dictFilePath = Path.Combine(dictFilePath, "handedict-zydeo.bin");
            dict         = new DictEngine(dictFilePath, new FontCoverageFull());

            // Initialize text provider
            TextProvider.Init();

            // Some static config parameters
            AppSettingsReader asr = new AppSettingsReader();

            gaCode = asr.GetValue("gaCode", typeof(string)).ToString();
        }
Exemplo n.º 3
0
 public static void Init()
 {
     instance = new TextProvider();
 }