Exemple #1
0
        public void InitPageLanguage()
        {
            if (Request.QueryString["language"] == null)
            {
                Page.Response.Redirect("/" + LanguageSetting.Setting.DefaultLanguage.Substring(0, 2) + PageDefinition.FE_HOME);
            }
            var language = Request.QueryString["language"];

            if (language.Equals(LanguageUtility.GetCurrentLanguage().Substring(0, 2)))
            {
                return;
            }
            if (language.Equals(LanguageSetting.Setting.DefaultLanguage.Substring(0, 2)))
            {
                LanguageUtility.SetCurrentUILanguage(LanguageSetting.Setting.DefaultLanguage);
                LanguageUtility.SetCurrentLanguage(LanguageSetting.Setting.DefaultLanguage);
                Page.Response.Redirect(Request.Url.AbsolutePath, true);
            }
            else
            {
                LanguageUtility.SetCurrentUILanguage(LanguageSetting.Setting.SecondLanguage);
                LanguageUtility.SetCurrentLanguage(LanguageSetting.Setting.SecondLanguage);
                Page.Response.Redirect(Request.Url.AbsolutePath, true);
            }
        }